Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2002:
[Freeciv-Dev] Re: Problems with dirent.h on MacOS X (PR#2249)
Home

[Freeciv-Dev] Re: Problems with dirent.h on MacOS X (PR#2249)

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: alexandre.enkerli@xxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Problems with dirent.h on MacOS X (PR#2249)
From: "Davide Pagnin via RT" <rt@xxxxxxxxxxxxxx>
Date: Mon, 11 Nov 2002 13:54:37 -0800
Reply-to: rt@xxxxxxxxxxxxxx

On Mon, 2002-11-11 at 20:48, alexandre.enkerli@xxxxxxxxxxxx via RT
wrote:
> 
> > Could you send me (just
> > me - not the list) the preprocessor output from your compiler?
> Here you go:

The attached patch has been applied to current cvs.

Can you check if latest cvs compile under you MacOS X environment, to
see if the problem is solved or not?

You can also try 1.14 stable branch code (and apply the attached patch)
to let us know if Stable with this patch works for you.

You can found at this page:
http://www.freeciv.org/contribute.html
instructions on how you can download the latest cvs or the stable
branch.

> >  With most compilers (on MacOS X do you use gcc?)
> Yes, and there's an issue with gcc3 that seemed to cause dialog 
> problems with pre-1.13 versions of the client.
> I went to <freeciv-source>/common and did this:
> gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -g -Wall -E -c `test -f 
> shared.c || echo './'`shared.c
> (based on the line before the problem).
> 
> Thanks a lot for your help.



Index: ai/ailog.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/ai/ailog.c,v
retrieving revision 1.1
diff -u -r1.1 ailog.c
--- ai/ailog.c  2002/09/28 21:58:15     1.1
+++ ai/ailog.c  2002/10/29 12:24:18
@@ -39,7 +39,7 @@
   va_list ap;
   int minlevel = MIN(LOGLEVEL_CITY, level);
 
-  if (minlevel > log_level) {
+  if (minlevel > fc_log_level) {
     return;
   }
 
@@ -68,7 +68,7 @@
   va_list ap;
   int minlevel = MIN(LOGLEVEL_UNIT, level);
 
-  if (minlevel > log_level) {
+  if (minlevel > fc_log_level) {
     return;
   }
 
@@ -95,7 +95,7 @@
 {
   int minlevel = MIN(LOGLEVEL_GOTO, level);
 
-  if (minlevel <= log_level && (result == GR_FAILED || result == GR_FOUGHT)) {
+  if (minlevel <= fc_log_level && (result == GR_FAILED || result == 
GR_FOUGHT)) {
     char buffer[500];
     char buffer2[500];
     va_list ap;
@@ -130,7 +130,7 @@
   int x = -1, y = -1, id = -1;
   char *s = "none";
 
-  if (minlevel > log_level) {
+  if (minlevel > fc_log_level) {
     return;
   }
 
Index: common/log.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/log.c,v
retrieving revision 1.39
diff -u -r1.39 log.c
--- common/log.c        2002/09/28 21:58:16     1.39
+++ common/log.c        2002/10/29 12:24:23
@@ -29,7 +29,7 @@
 static log_callback_fn log_callback;
 
 int logd_init_counter = 1;
-int log_level;
+int fc_log_level;
 
 struct logd_fileinfo {
   char *name;
@@ -47,7 +47,7 @@
 If there was a parsing problem, prints to stderr, and returns -1.
 
 Also sets up the logd_files data structure and increments
-logd_init_counter.  Does _not_ set log_level.
+logd_init_counter.  Does _not_ set fc_log_level.
 **************************************************************************/
 int log_parse_level_str(const char *level_str)
 {
@@ -173,7 +173,7 @@
 void log_init(const char *filename, int initial_level,
              log_callback_fn callback)
 {
-  log_level=initial_level;
+  fc_log_level=initial_level;
   log_filename=filename;
   log_callback=callback;
   freelog(LOG_VERBOSE, "log started");
@@ -185,7 +185,7 @@
 **************************************************************************/
 void log_set_level(int level)
 {
-  log_level=level;
+  fc_log_level=level;
 }
 
 /**************************************************************************
@@ -238,7 +238,7 @@
 
 /**************************************************************************
 Print a log message.
-Only prints if level <= log_level.
+Only prints if level <= fc_log_level.
 For repeat message, may wait and print instead
 "last message repeated ..." at some later time.
 Calls log_callback if non-null, else prints to stderr.
@@ -254,7 +254,7 @@
   static unsigned int prev=0;  /* total on last update */
   static int prev_level=-1;    /* only count as repeat if same level  */
 
-  if(level<=log_level) {
+  if(level<=fc_log_level) {
     FILE *fs;
 
     if(log_filename) {
Index: common/log.h
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/log.h,v
retrieving revision 1.19
diff -u -r1.19 log.h
--- common/log.h        2002/10/09 20:54:20     1.19
+++ common/log.h        2002/10/29 12:24:23
@@ -39,7 +39,7 @@
 #endif
 
 extern int logd_init_counter;   /* increment this to force re-init */
-extern int log_level;
+extern int fc_log_level;
 
 /* Return an updated struct logdebug_afile_info: */
 struct logdebug_afile_info logdebug_update(const char *file);
Index: common/shared.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/shared.c,v
retrieving revision 1.92
diff -u -r1.92 shared.c
--- common/shared.c     2002/09/27 12:32:44     1.92
+++ common/shared.c     2002/10/29 12:24:27
@@ -14,6 +14,10 @@
 #include <config.h>
 #endif
 
+#ifdef HAVE_SYS_TYPES_H
+/* Under Mac OS X sys/types.h must be included before dirent.h */
+#include <sys/types.h>
+#endif
 #include <assert.h>
 #include <dirent.h>
 #include <errno.h>

[Prev in Thread] Current Thread [Next in Thread]