crypt.h seems to be broken on many systems.
authorMarkus Bröker <mbroeker@largo.dyndns.tv>
Fri, 05 Mar 2010 23:16:32 +0100
changeset 119 305d2ca32936
parent 118 17dff2c6fc88
child 120 430dbec0c228
crypt.h seems to be broken on many systems. The manpage tells me that i have to include unistd.h... committer: Markus Bröker <mbroeker@largo.homelinux.org>
Makefile
crypt.c
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
      CC = gcc -g -ggdb $(PROF)
     CPP = g++ -g -ggdb $(PROF)
- CFLAGS = -Wall -O2 -Iinclude #-ansi
+ CFLAGS = -Wall -O2 -Iinclude $(EXTRA)
+  EXTRA = #-DNO_CRYPT
 LDFLAGS = -L/usr/lib
      RM = rm -f
    FIND = find
--- a/crypt.c
+++ b/crypt.c
@@ -6,7 +6,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
+#include <unistd.h>
+
+#ifndef NO_CRYPT
 #include <crypt.h>
+#endif
 
 #define GETRANDOM(max) ('a'+(int)((float)(max)*rand()/RAND_MAX+1.0))