This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
[patch] to gprof: obvious portability fix
- To: binutils at sources dot redhat dot com
- Subject: [patch] to gprof: obvious portability fix
- From: msokolov at ivan dot Harhan dot ORG (Michael Sokolov)
- Date: Sat, 27 Jan 01 00:46:27 PST
Hi there,
The patch below fixes an obvious portability bug in gprof. OK to commit?
--
Michael Sokolov
Public Service Agent
International Engineering and Science Task Force
1351 VINE AVE APT 27 Phone: +1-714-738-5409
FULLERTON CA 92833-4291 USA (home office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP)
P.S. Is there an "obviously correct" rule in Binutils like there is in GCC for
this sort of thing?
2001-01-27 Michael Sokolov <msokolov@ivan.Harhan.ORG>
* basic_blocks.c: #include <unistd.h> only if it exists.
Index: basic_blocks.c
===================================================================
RCS file: /cvs/src/src/gprof/basic_blocks.c,v
retrieving revision 1.3
diff -p -r1.3 basic_blocks.c
*** basic_blocks.c 2000/07/24 20:59:03 1.3
--- basic_blocks.c 2001/01/27 08:42:55
***************
*** 22,28 ****
02111-1307, USA. */
#include <stdio.h>
- #include <unistd.h>
#include "basic_blocks.h"
#include "corefile.h"
#include "gmon_io.h"
--- 22,27 ----
***************
*** 31,36 ****
--- 30,38 ----
#include "libiberty.h"
#include "source.h"
#include "sym_ids.h"
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
/* Default option values: */
bool bb_annotate_all_lines = FALSE;