This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] winsup/utils: port getconf to 64-bit


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=8502abb674e23e976ebdb85fb07934dd01172506

commit 8502abb674e23e976ebdb85fb07934dd01172506
Author: Yaakov Selkowitz <yselkowi@redhat.com>
Date:   Fri Apr 1 17:44:31 2016 -0500

    winsup/utils: port getconf to 64-bit
    
    The available specifications obviously differ on 32-bit and 64-bit, as
    already handled in <sys/features.h>.
    
    Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>

Diff:
---
 winsup/utils/getconf.c | 35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

diff --git a/winsup/utils/getconf.c b/winsup/utils/getconf.c
index 8732be1..993aa29 100644
--- a/winsup/utils/getconf.c
+++ b/winsup/utils/getconf.c
@@ -385,22 +385,33 @@ struct spec_variable {
   int valid;
 };
 
+#if __LP64__
+#define ILP32 0
+#define LP64 1
+#else
+#define ILP32 1
+#define LP64 0
+#endif
+
 static const struct spec_variable spec_table[] = {
-  { "POSIX_V7_ILP32_OFF32",	0 },
-  { "POSIX_V7_ILP32_OFFBIG",	1 },
-  { "POSIX_V7_LP64_OFF64",	0 },
-  { "POSIX_V7_LPBIG_OFFBIG",	0 },
-  { "POSIX_V6_ILP32_OFF32",	0 },
-  { "POSIX_V6_ILP32_OFFBIG",	1 },
-  { "POSIX_V6_LP64_OFF64",	0 },
-  { "POSIX_V6_LPBIG_OFFBIG",	0 },
-  { "XBS5_ILP32_OFF32",		0 },
-  { "XBS5_ILP32_OFFBIG",	1 },
-  { "XBS5_LP64_OFF64",		0 },
-  { "XBS5_LPBIG_OFFBIG",	0 },
+  { "POSIX_V7_ILP32_OFF32",	0	},
+  { "POSIX_V7_ILP32_OFFBIG",	ILP32	},
+  { "POSIX_V7_LP64_OFF64",	LP64	},
+  { "POSIX_V7_LPBIG_OFFBIG",	LP64	},
+  { "POSIX_V6_ILP32_OFF32",	0	},
+  { "POSIX_V6_ILP32_OFFBIG",	ILP32	},
+  { "POSIX_V6_LP64_OFF64",	LP64	},
+  { "POSIX_V6_LPBIG_OFFBIG",	LP64	},
+  { "XBS5_ILP32_OFF32",		0	},
+  { "XBS5_ILP32_OFFBIG",	ILP32	},
+  { "XBS5_LP64_OFF64",		LP64	},
+  { "XBS5_LPBIG_OFFBIG",	LP64	},
   { NULL, 0 },
 };
 
+#undef ILP32
+#undef LP64
+
 static int a_flag = 0;		/* list all variables */
 static int v_flag = 0;		/* follow given specification */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]