Commit 406be145 authored by jgarcia's avatar jgarcia
Browse files

Reduced the number of headers globally included.

parent 147a8ff6
......@@ -1147,7 +1147,7 @@ EXPORTS
expand_pathname
ecl_cstring_to_pathname
backup_fopen
ecl_backup_fopen
ecl_file_len
homedir_pathname
......
......@@ -1129,7 +1129,7 @@ EXPORTS
expand_pathname
ecl_cstring_to_pathname
backup_fopen
ecl_backup_fopen
ecl_file_len
homedir_pathname
......
......@@ -118,6 +118,11 @@ ECL 1.0:
- Function ecl_stream_to_handle() now exported.
- Function backup_fopen() renamed to ecl_backup_fopen().
- Minimized the number of headers included by ecl/ecl.h. In particular,
stdio.h, inittypes.h and pthread.h are no longer used.
* Contributed code:
- New examples: cmdline/ls.lsp, ffi/uffi.lsp
......
......@@ -380,9 +380,9 @@ ecl_open_stream(cl_object fn, enum ecl_smmode smm, cl_object if_exists,
if (if_exists == @':error')
FEcannot_open(fn);
else if (if_exists == @':rename') {
fp = backup_fopen(fname, (smm == smm_output)
? OPEN_W
: OPEN_RW);
fp = ecl_backup_fopen(fname, (smm == smm_output)
? OPEN_W
: OPEN_RW);
if (fp == NULL)
FEcannot_open(fn);
} else if (if_exists == @':rename_and_delete' ||
......
......@@ -16,6 +16,7 @@
#include <ecl/ecl.h>
#include <math.h>
#include <float.h>
#ifdef _MSC_VER
# undef complex
#endif
......
......@@ -21,6 +21,7 @@
*/
#include <ecl/ecl.h>
#include <limits.h>
#include <string.h>
#include <ctype.h>
#ifdef _MSC_VER
......
......@@ -17,6 +17,7 @@
#include <ecl/ecl.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <float.h>
#include <math.h>
#ifdef _MSC_VER
......
......@@ -15,6 +15,7 @@
*/
#include <ecl/ecl.h>
#include <stdio.h>
#include <limits.h>
#include <float.h>
#include <math.h>
......
......@@ -13,7 +13,6 @@
*/
#include <ecl/ecl.h>
#include <stdio.h>
#include <sys/types.h>
#include <errno.h>
......
......@@ -17,7 +17,6 @@
#include <pthread.h>
#include <signal.h>
#define GC_THREADS
#include <ecl/ecl.h>
#include <ecl/internal.h>
......
......@@ -112,7 +112,7 @@ cl_object
cl_get_internal_real_time()
{
#if defined(mingw32) || defined(_MSC_VER)
@(return MAKE_FIXNUM((cl_fixnum)((GetTickCount(0) - beginning)/1000.0*HZ)))
@(return MAKE_FIXNUM((cl_fixnum)((GetTickCount() - beginning)/1000.0*HZ)))
#else
@(return MAKE_FIXNUM((time(0) - beginning)*HZ))
#endif
......
......@@ -16,6 +16,7 @@
#include <ecl/ecl.h>
#include <string.h>
#include <stdio.h>
#ifndef _MSC_VER
# include <unistd.h>
#else
......@@ -263,8 +264,8 @@ ERROR: FElibc_error("Can't change the current directory to ~S",
@(return pathname)
}
FILE *
backup_fopen(const char *filename, const char *option)
void *
ecl_backup_fopen(const char *filename, const char *option)
{
char backupfilename[MAXPATHLEN];
......@@ -281,11 +282,11 @@ backup_fopen(const char *filename, const char *option)
}
cl_object
ecl_file_len(FILE *fp)
ecl_file_len(void *fp)
{
struct stat filestatus;
fstat(fileno(fp), &filestatus);
fstat(fileno((FILE*)fp), &filestatus);
return make_integer(filestatus.st_size);
}
......
......@@ -16,6 +16,7 @@
#include <ecl/ecl.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <ecl/internal.h>
#ifdef mingw32
......
......@@ -16,7 +16,9 @@
(defun c1constant-value (val &key always only-small-values)
(cond
((let ((x (assoc val +optimizable-constant+)))
(and x (c1expr (cdr x)))))
(when x
(pushnew "#include <float.h>" *clines-string-list*)
(c1expr (cdr x)))))
((eq val nil) (c1nil))
((eq val t) (c1t))
((sys::fixnump val)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment