be friendly to non-Linux non-gcc systems

This commit is contained in:
leitner
2002-09-07 11:31:53 +00:00
parent b1960800b8
commit e6eb6100ab
3 changed files with 8 additions and 5 deletions

View File

@@ -44,7 +44,7 @@ endif
ar cru $@ $^
%: %.c
$(DIET) $(CC) $(CFLAGS) -o $@ $^ -lowfat
$(DIET) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) -lowfat
t1 parse: ldif.a storage.a
t2: ldap.a asn1.a
@@ -54,10 +54,10 @@ bindrequest tinyldap tinyldap_standalone tinyldap_debug ldapclient ldapclient_st
idx2ldif: ldap.a
tinyldap_standalone: tinyldap.c
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ -lowfat
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -o $@ $^ $(LDFLAGS) -lowfat
tinyldap_debug: tinyldap.c
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ -lowfat
$(DIET) $(CC) $(CFLAGS) -DSTANDALONE -DDEBUG -o $@ $^ $(LDFLAGS) -lowfat
.PHONY: clean tar
clean:

View File

@@ -1,3 +1,4 @@
#include <alloca.h>
#include <buffer.h>
#include <scan.h>
#include <open.h>
@@ -195,8 +196,9 @@ struct ldaprec *first=0;
int ldif_parse(const char* filename) {
char buf[4096];
int fd=open_read(filename);
buffer in=BUFFER_INIT(read,fd,buf,sizeof buf);
buffer in;
if (fd<0) return 1;
buffer_init(&in,read,fd,buf,sizeof buf);
dn=mduptab_adds(&attributes,"dn");
objectClass=mduptab_adds(&attributes,"objectClass");
{

3
t1.c
View File

@@ -115,8 +115,9 @@ struct ldaprec *first=0;
int parse_ldif(const char* filename) {
char buf[4096];
int fd=open_read(filename);
buffer in=BUFFER_INIT(read,fd,buf,sizeof buf);
buffer in;
if (fd<0) return 1;
buffer_init(&in,read,fd,buf,sizeof buf);
dn=strduptab_add(&tags,"dn");
mail=strduptab_add(&tags,"mail");
sn=strduptab_add(&tags,"sn");