Re: HP-UX and AIX buiild problems and patches

2003-01-27 Thread Andrew V. Samoilov
Hello!

Alexander Varakin wrote:

Hi,

I tried to build mc-4.6.0-pre3 on HP-UX and AIX and ran into some problems,
which I fixed, patches are attached.
I was using native c compilers  on both (xlc_r from Visual  Age 5.0 on AIX,
and  aCC 3.31 on HP-UX) , which are more picky than gcc, so some fixes were
required to make them happy.


Well, I commited changed version of your HP patch to CVS.
BTW, can you send me compiler output for src/util.c.  I want to know, 
are there warnings or errors.

--
Regards,
Andrew V. Samoilov
Index: mc/edit/ChangeLog
diff -u mc/edit/ChangeLog:1.147 mc/edit/ChangeLog:1.148
--- mc/edit/ChangeLog:1.147 Wed Dec 25 17:53:07 2002
+++ mc/edit/ChangeLog   Mon Jan 27 10:46:40 2003
@@ -1,3 +1,8 @@
+2003-01-27  Andrew V. Samoilov  [EMAIL PROTECTED]
+
+   * edit-widget.h (struct macro): Move definition ...
+   * edit.h: ... here to fix compilation on HP-UX.
+
 2002-12-25  Pavel Roskin  [EMAIL PROTECTED]
 
* editkeys.c: Move key maps to the file scope.  Put common keys
Index: mc/edit/edit.h
diff -u mc/edit/edit.h:1.60 mc/edit/edit.h:1.61
--- mc/edit/edit.h:1.60 Wed Dec 25 17:53:07 2002
+++ mc/edit/edit.h  Mon Jan 27 10:46:40 2003
@@ -102,10 +102,15 @@
 #define MARK_2 7
 #define KEY_PRESS 14
 
-/*Tabs spaces: (sofar only HALF_TAB_SIZE is used: */
+/* Tabs spaces: (sofar only HALF_TAB_SIZE is used: */
 #define TAB_SIZE   option_tab_spacing
 #define HALF_TAB_SIZE  ((int) option_tab_spacing / 2)
 
+struct macro {
+short command;
+short ch;
+};
+
 struct selection {
unsigned char * text;
int len;
@@ -221,7 +226,6 @@
 void edit_right_word_move (WEdit * edit, int s);
 void edit_get_selection (WEdit * edit);
 
-struct macro;
 int edit_save_macro_cmd (WEdit * edit, struct macro macro[], int n);
 int edit_load_macro_cmd (WEdit * edit, struct macro macro[], int *n, int k);
 void edit_delete_macro_cmd (WEdit * edit);
Index: mc/edit/edit-widget.h
diff -u mc/edit/edit-widget.h:1.13 mc/edit/edit-widget.h:1.14
--- mc/edit/edit-widget.h:1.13  Mon Dec 16 00:21:42 2002
+++ mc/edit/edit-widget.h   Mon Jan 27 10:46:40 2003
@@ -7,11 +7,6 @@
 #define MAX_MACRO_LENGTH 1024
 #define N_LINE_CACHES 32
 
-struct macro {
-short command;
-short ch;
-};
-
 #define BOOK_MARK_COLOR ((25  8) | 5)
 #define BOOK_MARK_FOUND_COLOR ((26  8) | 4)
 



Re: HP-UX and AIX buiild problems and patches

2003-01-27 Thread Andrew V. Samoilov
Alexander Varakin wrote:

Hi Andrew,

I don't have access to AIX box right now, but I am sure that the build 
problems in util.c are not warnings. The AIX xlc_r compiler is very 
strict, so it produced errors there.

Attached hunk of your AIX patch is not clear for me:

--
Regards,
Andrew V. Samoilov

*** mc-4.6.0-pre3/src/util.cWed Jan 22 01:12:16 2003
--- mc-4.6.0-pre3.org/src/util.cFri Jan 24 10:28:17 2003
***
*** 47,53 
  #include charsets.h
  #endif
  
! static const char app_text [] = Midnight-Commander;
  int easy_patterns = 1;
  
  static inline int
--- 47,54 
  #include charsets.h
  #endif
  
! 
! const char app_text [] = Midnight-Commander;
  int easy_patterns = 1;
  
  static inline int



Re: HP-UX and AIX buiild problems and patches

2003-01-27 Thread Alexander Varakin
The problem here is that app_text was declared as

extern const char app_text [];

in header file, and then it was defined in c file as

static const char app_text [] = 

which is not consistent, so the compiler complained about this.

Alex



From: Andrew V. Samoilov [EMAIL PROTECTED]
To: Alexander Varakin [EMAIL PROTECTED]
CC: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: HP-UX and AIX buiild problems and patches
Date: Mon, 27 Jan 2003 19:17:23 +0200

Alexander Varakin wrote:

Hi Andrew,

I don't have access to AIX box right now, but I am sure that the build 
problems in util.c are not warnings. The AIX xlc_r compiler is very 
strict, so it produced errors there.

Attached hunk of your AIX patch is not clear for me:

--
Regards,
Andrew V. Samoilov
*** mc-4.6.0-pre3/src/util.c	Wed Jan 22 01:12:16 2003
--- mc-4.6.0-pre3.org/src/util.c	Fri Jan 24 10:28:17 2003
***
*** 47,53 
  #include charsets.h
  #endif

! static const char app_text [] = Midnight-Commander;
  int easy_patterns = 1;

  static inline int
--- 47,54 
  #include charsets.h
  #endif

!
! const char app_text [] = Midnight-Commander;
  int easy_patterns = 1;

  static inline int



_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

___
Mc-devel mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/mc-devel


Re: HP-UX and AIX buiild problems and patches

2003-01-27 Thread Andrew V. Samoilov
Alexander Varakin ÐÉÛÅÔ:

The problem here is that app_text was declared as

extern const char app_text [];

in header file, and then it was defined in c file as

static const char app_text [] = 

which is not consistent, so the compiler complained about this.

Alex



From: Andrew V. Samoilov [EMAIL PROTECTED]
To: Alexander Varakin [EMAIL PROTECTED]
CC: [EMAIL PROTECTED], [EMAIL PROTECTED]
Subject: Re: HP-UX and AIX buiild problems and patches
Date: Mon, 27 Jan 2003 19:17:23 +0200

Alexander Varakin wrote:


Hi Andrew,

I don't have access to AIX box right now, but I am sure that the 
build problems in util.c are not warnings. The AIX xlc_r compiler is 
very strict, so it produced errors there.


Attached hunk of your AIX patch is not clear for me:

--
Regards,
Andrew V. Samoilov
*** mc-4.6.0-pre3/src/util.cWed Jan 22 01:12:16 2003
--- mc-4.6.0-pre3.org/src/util.cFri Jan 24 10:28:17 2003
***
*** 47,53 
  #include charsets.h
  #endif

! static const char app_text [] = Midnight-Commander;
  int easy_patterns = 1;

  static inline int
--- 47,54 
  #include charsets.h
  #endif

!
! const char app_text [] = Midnight-Commander;
  int easy_patterns = 1;

  static inline int


I removed app_text declaration from util.h.
Thanks for report.

MC compilation must be smoothly now on AIX and possible some other systems.

--
Regards,
Andrew V. Samoilov

Index: mc/src/ChangeLog
diff -u mc/src/ChangeLog:1.1108 mc/src/ChangeLog:1.1109
--- mc/src/ChangeLog:1.1108 Mon Jan 27 12:16:11 2003
+++ mc/src/ChangeLogMon Jan 27 12:51:53 2003
@@ -1,3 +1,9 @@
+2003-01-27  Andrew V. Samoilov  [EMAIL PROTECTED]
+
+   * mountlist.c (read_filesystem_list) [MOUNTED_GETMNTENT1]:
+   Check for MOUNTED is defined to fix compilation on AIX.
+   Reported by Alexander Varakin [EMAIL PROTECTED].
+
 2003-01-27  Pavel Roskin  [EMAIL PROTECTED]
 
* main.c (update_xterm_title_path): Use is_printable().
Index: mc/src/mountlist.c
diff -u mc/src/mountlist.c:1.14 mc/src/mountlist.c:1.15
--- mc/src/mountlist.c:1.14 Tue Sep 24 18:19:32 2002
+++ mc/src/mountlist.c  Mon Jan 27 12:51:53 2003
@@ -201,13 +201,13 @@
 mlist = mtail = me;
 
 #ifdef MOUNTED_GETMNTENT1  /* 4.3BSD, SunOS, HP-UX, Dynix, Irix.  */
+#ifdef MOUNTED
 {
struct mntent *mnt;
-   char *table = MOUNTED;
FILE *fp;
char *devopt;
 
-   fp = setmntent (table, r);
+   fp = setmntent (MOUNTED, r);
if (fp == NULL)
return NULL;
 
@@ -238,6 +238,7 @@
if (endmntent (fp) == 0)
return NULL;
 }
+#endif /* MOUNTED */
 #endif /* MOUNTED_GETMNTENT1 */
 
 #ifdef MOUNTED_GETMNTINFO  /* 4.4BSD.  */