more fixes for Linux from Aldy

This commit is contained in:
Sean C. Rhea
2006-12-01 22:51:27 +00:00
parent ed34c54724
commit 0d37100719
4 changed files with 6 additions and 2 deletions

View File

@@ -18,6 +18,7 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>

View File

@@ -29,7 +29,7 @@ clean:
rm -f *.o libgc.a
libgc.a: pt.o cpint.o
$(LIBTOOL) -static -o $@ $^
ar q $@ $^
pt.o: pt.h

View File

@@ -18,6 +18,7 @@
* Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
@@ -305,7 +306,7 @@ combine_cpi_files(const char *dir, double *bests[], int *bestlen)
dirp = opendir(dir);
assert(dirp);
while ((dp = readdir(dirp)) != NULL) {
if (strcmp(".cpi", dp->d_name + dp->d_namlen - 4) == 0) {
if (strcmp(".cpi", dp->d_name + strlen(dp->d_name) - 4) == 0) {
sprintf(inname, "%s/%s", dir, dp->d_name);
read_one(inname, bests, bestlen);
}

View File

@@ -21,8 +21,10 @@
#ifndef __pt_h
#define __pt_h 1
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <time.h>
#include <sys/time.h>
#include <getopt.h>