This solves more than a thousend Wundef warnings.
*************************************************************************/
%{
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#include <ast.h>
#endif
#include <stdio.h>
};
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
/* fine control of object callbacks */
# if defined(_BLD_agraph) && defined(__EXPORT__)
# define extern __EXPORT__
#define aghead(e) AGHEAD(e)
#define agopp(e) AGOPP(e)
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
# if !defined(_BLD_agraph) && defined(__IMPORT__)
# define extern __IMPORT__
# endif
Agstrictundirected;
#undef extern
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
_END_EXTERNS_
#endif
#ifdef __cplusplus
extern unsigned int dtstrhash _ARG_((unsigned int, Void_t*, int));
#if 0
-#if !_PACKAGE_ast
+#if !defined(_PACKAGE_ast)
extern int memcmp _ARG_((const Void_t*, const Void_t*, size_t));
extern int strcmp _ARG_((const char*, const char*));
#endif
};
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
/* fine control of object callbacks */
# if defined(_BLD_cgraph) && defined(__EXPORT__)
# define extern __EXPORT__
#define TAILPORT_ID "tailport"
#define HEADPORT_ID "headport"
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
# if !defined(_BLD_cgraph) && defined(__IMPORT__)
# define extern __IMPORT__
# endif
#define EDGEOF(sn,rep) (AGSNMAIN(sn)?((Agedge_t*)((unsigned char*)(rep) - offsetof(Agedge_t,seq_link))) : ((Dthold_t*)(rep))->obj)
#undef extern
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
_END_EXTERNS_
#endif
#ifdef __cplusplus
#ifndef _GRAPH_H
#define _GRAPH_H 1
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#include <ast.h>
#else
#include <sys/types.h>
Agproto_t *prev;
};
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
_BEGIN_EXTERNS_ /* public data */
#if _BLD_graph && defined(__EXPORT__)
#define extern __EXPORT__
#define agmetanode(g) ((g)->meta_node)
#undef extern
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
_END_EXTERNS_
#endif
#ifdef __cplusplus
#ifndef _LIBGRAPH_H
#define _LIBGRAPH_H 1
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#include <ast.h>
#else
#include <stdarg.h>
* n - the order of the matrices A and Ainv
*/
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#include <ast.h>
#else
#endif
#include <vthread.h>
/* file system info */
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#include <ast.h>
#include <ast_time.h>
#define _lib_locale 1
#endif
-#else /*!_PACKAGE_ast */
+#else /*!defined(_PACKAGE_ast) */
#if __mips == 2 && !defined(_NO_LARGEFILE64_SOURCE)
#define _NO_LARGEFILE64_SOURCE 1
#include <unistd.h>
#endif
-#endif /*_PACKAGE_ast*/
+#endif /*defined(_PACKAGE_ast)*/
#include <errno.h>
#include <ctype.h>
#define ESPIPE 29
#endif
/* see if we can use memory mapping for io */
-#if !_PACKAGE_ast && _mmap_worthy
+#if !defined(_PACKAGE_ast) && _mmap_worthy
# ifdef _LARGEFILE64_SOURCE
# undef mmap
# endif
#define SF_RADIX 64 /* maximum integer conversion base */
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#define SF_MAXINT INT_MAX
#define SF_MAXLONG LONG_MAX
#else
#define max(x,y) ((x) > (y) ? (x) : (y))
/* fast functions for memory copy and memory clear */
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#define memclear(s,n) memzero(s,n)
#else
#if _lib_bcopy && !_lib_memcpy
#else
#define memclear(s,n) memset((s),'\0',(n))
#endif
-#endif /*_PACKAGE_ast*/
+#endif /*defined(_PACKAGE_ast)*/
/* note that MEMCPY advances the associated pointers */
#define MEMCPY(to,fr,n) \
extern int munmap _ARG_((Void_t *, size_t));
#endif
-#if !_PACKAGE_ast
+#if !defined(_PACKAGE_ast)
#if /*!__STDC__ &&*/ !_hdr_stdlib
extern void abort _ARG_((void));
extern int open _ARG_((const char *, int, ...));
#endif
-#endif /* _PACKAGE_ast */
+#endif /* defined(_PACKAGE_ast) */
_END_EXTERNS_
#endif /*_SFHDR_H*/
** Written by Kiem-Phong Vo
*/
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#include <ast_std.h>
#else
#include <ast_common.h>
#endif
#endif
-#endif /* _PACKAGE_ast */
+#endif /* defined(_PACKAGE_ast) */
/* Sfoff_t should be large enough for largest file address */
*/
/* the below is for protecting the application from SIGPIPE */
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#include <sig.h>
#include <wait.h>
#define Sfsignal_f Sig_handler_t
CLOSE(p->file);
/* wait for process termination */
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
sigcritical(1);
#endif
#ifndef WIN32
#endif
if (pid < 0)
status = -1;
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
sigcritical(0);
#endif
*************************************************************************/
#include "sfhdr.h"
-#if !_PACKAGE_ast
+#if !defined(_PACKAGE_ast)
#ifndef FIONREAD
#if _sys_ioctl
#include <sys/ioctl.h>
** Written by Kiem-Phong Vo.
*/
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#include <proc.h>
#else
_exit(EXIT_NOTFOUND);
}
-#endif /*_PACKAGE_ast*/
+#endif /*defined(_PACKAGE_ast)*/
#ifndef WIN32
#if __STD_C
char *mode; /* mode of the stream */
#endif
{
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
reg Proc_t *proc;
reg int sflags;
reg long flags;
}
return NIL(Sfio_t *);
}
-#endif /*_PACKAGE_ast*/
+#endif /*defined(_PACKAGE_ast)*/
}
#endif
return 0;
}
-#if !_PACKAGE_ast
+#if !defined(_PACKAGE_ast)
#include <time.h>
#define TMPDFLT "/tmp"
static char **Tmppath, **Tmpcur;
return dirs;
}
-#endif /*!_PACKAGE_ast */
+#endif /*!defined(_PACKAGE_ast) */
#if __STD_C
static int _tmpfd(Sfio_t * f)
reg int fd;
int t;
-#if !_PACKAGE_ast
+#if !defined(_PACKAGE_ast)
/* set up path of dirs to create temp files */
if (!Tmppath && !(Tmppath = _sfgetpath("TMPPATH"))) {
if (!(Tmppath = (char **) malloc(2 * sizeof(char *))))
Tmpcur += 1;
if (!Tmpcur || !Tmpcur[0])
Tmpcur = Tmppath;
-#endif /*!_PACKAGE_ast */
+#endif /*!defined(_PACKAGE_ast) */
file = NIL(char *);
fd = -1;
for (t = 0; t < 10; ++t) { /* compute a random name */
-#if !_PACKAGE_ast
+#if !defined(_PACKAGE_ast)
static ulong Key, A;
if (A == 0 || t > 0) { /* get a quasi-random coefficient */
reg int r;
Tmpcur[0], (Key >> 15) & 0x7fff, Key & 0x7fff);
#else
file = pathtmp(file, NiL, "sf", NiL);
-#endif /*!_PACKAGE_ast */
+#endif /*!defined(_PACKAGE_ast) */
if (!file)
return -1;
if (fd >= 0)
_rmtmp(f, file);
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
free(file);
-#endif /*_PACKAGE_ast*/
+#endif /*defined(_PACKAGE_ast)*/
return fd;
}
#include <errno.h>
/* ast doesn't do threads yet */
-#if _PACKAGE_ast && !defined(vt_threaded)
+#if defined(_PACKAGE_ast) && !defined(vt_threaded)
#define vt_threaded 0
#endif
}
*next = '\0';
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
return open(buf, O_WRONLY | O_CREAT | O_TRUNC, CREAT_MODE);
#else
return creat(buf, CREAT_MODE);
#define VMALLOC_VERSION 19990805L
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#include <ast_std.h>
#else
#include <ast_common.h>
** Any required functions for process exiting.
** Written by Kiem-Phong Vo, kpv@research.att.com (05/25/93).
*/
-#if _PACKAGE_ast || _lib_atexit
+#if defined(_PACKAGE_ast) || _lib_atexit
int Vm_atexit_already_defined;
#else
*/
-#if _PACKAGE_ast
+#if defined(_PACKAGE_ast)
#if defined(__STDPP__directive) && defined(__STDPP__hide)
__STDPP__directive pragma pp:hide getpagesize
#include <ast_common.h>
#include "FEATURE/vmalloc"
-#endif /*_PACKAGE_ast*/
+#endif /*defined(_PACKAGE_ast)*/
#undef free
#undef malloc
_BEGIN_EXTERNS_ extern Vmextern_t _Vmextern;
-#if !_PACKAGE_ast
+#if !defined(_PACKAGE_ast)
extern size_t getpagesize _ARG_((void));