pdf-devel
[Top][All Lists]
Advanced

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

[pdf-devel] Compiling for windows


From: Aleksander Morgado
Subject: [pdf-devel] Compiling for windows
Date: Thu, 17 Apr 2008 21:39:22 +0200 (CEST)
User-agent: SquirrelMail/1.4.9a

Hi all,

I started the development of FS#15 (Windows host encoding support), and
found a small problem in the pdf-stm-file.c file: S_IRGRP and S_IROTH are
not defined in windows (no way to deal with permissions for group or
others).

After correcting this bug everything compiles correctly with mingw32
cross-compiling. I will add another task in the Flyspray to implement the
DLL-compilation of libgnupdf (it's statically linked to the binaries now).

BTW... there is no way to run the unit tests in windows (Check works only
in POSIX environments)... how can we manage this?



Here's the patch:

Index: src/base/pdf-stm-file.c
===================================================================
RCS file: /cvsroot/pdf/libgnupdf/src/base/pdf-stm-file.c,v
retrieving revision 1.4
diff -c -r1.4 pdf-stm-file.c
*** src/base/pdf-stm-file.c     5 Mar 2008 11:32:04 -0000       1.4
--- src/base/pdf-stm-file.c     17 Apr 2008 19:09:10 -0000
***************
*** 71,86 ****
        }
      case PDF_STM_FILE_OPEN_MODE_WRITE:
        {
          (*data)->filedes = open ((*data)->filename,
                                   O_WRONLY | O_CREAT | O_TRUNC,
!                                  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
          break;
        }
      case PDF_STM_FILE_OPEN_MODE_RW:
        {
          (*data)->filedes = open ((*data)->filename,
                                   O_RDWR | O_CREAT,
!                                  S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
          break;
        }
      default:
--- 71,100 ----
        }
      case PDF_STM_FILE_OPEN_MODE_WRITE:
        {
+         int mode = S_IRUSR | S_IWUSR;
+ #ifdef S_IRGRP
+         mode |= S_IRGRP;
+ #endif
+ #ifdef S_IROTH
+         mode |= S_IROTH;
+ #endif
          (*data)->filedes = open ((*data)->filename,
                                   O_WRONLY | O_CREAT | O_TRUNC,
!                                  mode);
          break;
        }
      case PDF_STM_FILE_OPEN_MODE_RW:
        {
+         int mode = S_IRUSR | S_IWUSR;
+ #ifdef S_IRGRP
+         mode |= S_IRGRP;
+ #endif
+ #ifdef S_IROTH
+         mode |= S_IROTH;
+ #endif
          (*data)->filedes = open ((*data)->filename,
                                   O_RDWR | O_CREAT,
!                                  mode);
          break;
        }
      default:







reply via email to

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