gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] MinGW Port (Request and Question)


From: Peg
Subject: [open-cobol-list] MinGW Port (Request and Question)
Date: Fri Dec 2 01:01:02 2005
User-agent: Thunderbird 1.5 (Windows/20051025)

Hello All,
I tried to compile OpenCOBOL by using MinGW.
However, several compile errors were received.

(Request)
Could you correct the code when there is time though
other problems are in the use of OpenCOBOL with MinGW?

1.libcob/common.c
  There are neither signal SIGHUP and SIGQUIT in Windows.
  I did CommentOut.

2.libcob/byteswap.h
  Because int8_t, int16_t, int32_t, int64_t and register_t
  has defined it in stdint.h, it becomes a compile error.
  I did CommentOut.(u_intx_t is defined by uintx_t.)

3.libcob/fileio.c
  There is no fsync. I corrected it as follows.

fileio.c : 44
 #ifdef _WIN32
 #include <windows.h>           /* for GetTempPath, GetTempFileName */
+#define fsync _commit
 #endif

  Please correct the following codes.

fileio.c : 320
-                       fsync (fileno (f->file));
+                       fsync (fileno ((FILE *)f->file));

fileio.c : 532
-                       fcntl (fileno (f->file), F_SETLK, &lock);
+                       fcntl (fileno ((FILE *)f->file), F_SETLK, &lock);

fileio.c : 98
-#define SEEK_INIT(f)   fseek (f->file, 0, SEEK_CUR)
+#define SEEK_INIT(f)   fseek (f->file, (off_t) 0, SEEK_CUR)

  RELATIVE doesn't operate.

fileio.c : 446
                if (f->organization == COB_ORG_RELATIVE)
                        fp = fopen (filename, "wb+");
 #ifndef        __MINGW32__
                else if (f->organization == COB_ORG_LINE_SEQUENTIAL)
                        fp = fopen (filename, "w");
                else
-#endif
                        fp = fopen (filename, "wb");
+#endif
                break;

(Question)
There is a question about _ setmode of LINE SEQUENTIAL and common.c.
In the software that moves with Windows, the line feed code is CR+LF.
I had added the following codes to fileio.c before.
(It asked Keisuke for the addition.)

fileio.c (file_open Function)
+               if (f->organization == COB_ORG_LINE_SEQUENTIAL)
+                       fp = fopen (filename, "r");
+               else
                        fp = fopen (filename, "rb");
and more...

However, it is not effective in a recent code.

fileio.c (CVS 2005/11/29 file_open Function)
#ifndef __MINGW32__
                if (f->organization == COB_ORG_LINE_SEQUENTIAL)
                        fp = fopen (filename, "r");
                else
#endif
                        fp = fopen (filename, "rb");
and more...

I want to hear the reason for this correction.
"make check" fails in CR+LF the line feed code.
Does the reason relate to it? Or, it other?

Regards,

--
Shigeyuki Kanbe
Peg, PegStyle mailto:address@hidden
http://members8.tsukaeru.net/pegstyle/


reply via email to

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