summaryrefslogtreecommitdiff
path: root/gcc/ada/s-oscons-tmplt.c
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 10:23:29 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-20 10:23:29 +0000
commitf060ec3ac5d577d1ee18d289eb3330ca162676b5 (patch)
tree574ce9131a64849db6a95cbc24418300aacf56dd /gcc/ada/s-oscons-tmplt.c
parent442049cc40ee654b6b24371b05d7ea79e2e0657c (diff)
downloadgcc-f060ec3ac5d577d1ee18d289eb3330ca162676b5.tar.gz
2009-04-20 Thomas Quinot <quinot@adacore.com>
* s-oscons-tmplt.c: Add support for generating a dummy version of s-oscons.ads providing all possible constants. * g-socthi-mingw.ads: Fix calling convention for __gnat_inet_pton. * socket.c (__gnat_inet_pton): On Windows make sure we always use the ANSI version (not the UNICODE version) of WSAStringToAddress. 2009-04-20 Pascal Obry <obry@adacore.com> * adaint.c (__gnat_set_OWNER_ACL): properly free memory allocated for the security descriptor and make sure all handles are closed before leaving this procedure. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146392 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-oscons-tmplt.c')
-rw-r--r--gcc/ada/s-oscons-tmplt.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/gcc/ada/s-oscons-tmplt.c b/gcc/ada/s-oscons-tmplt.c
index be35f1b216d..2bcb80a6f0c 100644
--- a/gcc/ada/s-oscons-tmplt.c
+++ b/gcc/ada/s-oscons-tmplt.c
@@ -79,10 +79,6 @@ pragma Style_Checks ("M32766");
**
**/
-#ifndef TARGET
-# error Please define TARGET
-#endif
-
#include <stdlib.h>
#include <string.h>
#include <limits.h>
@@ -95,6 +91,26 @@ pragma Style_Checks ("M32766");
#include "gsocket.h"
+#ifdef DUMMY
+
+# if defined (TARGET)
+# error TARGET may not be defined when generating the dummy version
+# else
+# define TARGET "batch runtime compilation (dummy values)"
+# endif
+
+# if !(defined (HAVE_SOCKETS) && defined (HAVE_TERMIOS))
+# error Features missing on platform
+# endif
+
+# define NATIVE
+
+#endif
+
+#ifndef TARGET
+# error Please define TARGET
+#endif
+
#ifndef HAVE_SOCKETS
# include <errno.h>
#endif
@@ -109,8 +125,16 @@ pragma Style_Checks ("M32766");
#ifdef NATIVE
#include <stdio.h>
+
+#ifdef DUMMY
+int counter = 0;
+# define _VAL(x) counter++
+#else
+# define _VAL(x) x
+#endif
+
#define CND(name,comment) \
- printf ("\n->CND:$%d:" #name ":$%d:" comment, __LINE__, ((int) name));
+ printf ("\n->CND:$%d:" #name ":$%d:" comment, __LINE__, ((int) _VAL (name)));
#define CNS(name,comment) \
printf ("\n->CNS:$%d:" #name ":" name ":" comment, __LINE__);
@@ -1179,9 +1203,11 @@ TXT(" Thread_Blocking_IO : constant Boolean := True;")
/**
** System-specific constants follow
+ ** Each section should be activated if compiling for the corresponding
+ ** platform *or* generating the dummy version for runtime test compilation.
**/
-#ifdef __vxworks
+#if defined (__vxworks) || defined (DUMMY)
/*
@@ -1198,7 +1224,7 @@ CND(ERROR, "VxWorks generic error")
#endif
-#ifdef __MINGW32__
+#if defined (__MINGW32__) || defined (DUMMY)
/*
------------------------------
@@ -1220,7 +1246,7 @@ CND(WSAEDISCON, "Disconnected")
putchar ('\n');
#endif
-#ifdef __APPLE__
+#if defined (__APPLE__) || defined (DUMMY)
/*
-------------------------------