diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2012-02-11 23:12:02 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2012-02-11 23:12:02 +0000 |
commit | 6ba9da3c0c15cfa2410282373c844eca4d2f3daa (patch) | |
tree | ee6b176f22f153e34bcdb99a820fa7ebec74e8fa /lib/pm.h | |
parent | a09ba27efb46ed72b2f60d24fac2ff2dac7b3c13 (diff) | |
download | netpbm-mirror-6ba9da3c0c15cfa2410282373c844eca4d2f3daa.tar.gz netpbm-mirror-6ba9da3c0c15cfa2410282373c844eca4d2f3daa.tar.xz netpbm-mirror-6ba9da3c0c15cfa2410282373c844eca4d2f3daa.zip |
Fix open flags for Windows mkstempx()
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@1634 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/pm.h')
-rw-r--r-- | lib/pm.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/pm.h b/lib/pm.h index 7870e1c7..21efea20 100644 --- a/lib/pm.h +++ b/lib/pm.h @@ -21,6 +21,7 @@ #include <errno.h> #include <setjmp.h> #include <sys/stat.h> +#include <fcntl.h> #ifdef __cplusplus extern "C" { @@ -75,6 +76,26 @@ extern "C" { #define PURE_FN_ATTR #endif + +/* S_IRUSR is POSIX, defined in <sys/stat.h> Some old BSD systems and Windows + systems have S_IREAD instead. Most Unix today (2011) has both. In 2011, + Android has S_IRUSR and not S_IREAD. + + Some Windows has _S_IREAD. + + We're ignoring S_IREAD now to see if anyone misses it. If there are still + users that need it, we can handle it here. +*/ +#if WIN32 + #define PM_S_IWUSR _S_IWRITE + #define PM_S_IRUSR _S_IREAD +#else + #define PM_S_IWUSR S_IWUSR + #define PM_S_IRUSR S_IRUSR +#endif + + + typedef struct { /* Coordinates of a pixel within an image. Row 0 is the top row. Column 0 is the left column. |