TP3: avoid warning on cygwin
authorJerome Benoit <jerome.benoit@sap.com>
Sun, 5 Mar 2017 12:55:43 +0000 (13:55 +0100)
committerJerome Benoit <jerome.benoit@sap.com>
Sun, 5 Mar 2017 12:55:43 +0000 (13:55 +0100)
Signed-off-by: Jerome Benoit <jerome.benoit@sap.com>
TP3/macros.h [new file with mode: 0644]
TP3/tp3.c

diff --git a/TP3/macros.h b/TP3/macros.h
new file mode 100644 (file)
index 0000000..37b02b8
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef MACROS_H
+#define MACROS_H
+
+/* definition to expand macro then apply to pragma message */
+#define VALUE_TO_STRING(x) #x
+#define VALUE(x) VALUE_TO_STRING(x)
+#define VAR_NAME_VALUE(var) #var "="  VALUE(var)
+
+#endif /* MACROS_h */
index 52c2a6e398be161c61c1f8af0837bd79bbff265a..ffb53c20129a24e92077dd83c3acc105273c7e65 100644 (file)
--- a/TP3/tp3.c
+++ b/TP3/tp3.c
@@ -1,4 +1,8 @@
 #include <stdio.h>
+#if __BSD_VISIBLE
+#undef __BSD_VISIBLE
+#define __BSD_VISIBLE
+#endif
 #include <stdlib.h>
 
 void AfficheTab(int T[], int n) {