1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-21 00:25:50 +00:00

- Fix build with clang

Reported by:	pkg-fallout
This commit is contained in:
Sofian Brabez 2014-03-06 14:31:13 +00:00
parent 464921619b
commit 4650e5d6e4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=347237
2 changed files with 45 additions and 11 deletions

View File

@ -8,25 +8,21 @@ MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}/${PORTNAME}-${PORTVERSION}
MAINTAINER= sbz@FreeBSD.org
COMMENT= HexInject is a versatile packet injector and sniffer
COMMENT= HexInject is a very versatile packet injector and sniffer
LICENSE= BSD
LICENSE= BSD2CLAUSE
LIB_DEPENDS= libpcap.so:${PORTSDIR}/net/libpcap
PLIST_FILES= bin/${PORTNAME}
WRKSRC= ${WRKDIR}/${PORTNAME}
NO_STAGE= yes
post-patch:
${REINPLACE_CMD} -e 's#gcc#${CC}#g' ${WRKSRC}/Makefile
${REINPLACE_CMD} -e '2s#-lpcap#-L${LOCALBASE}/lib -lpcap#' ${WRKSRC}/Makefile
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
.include <bsd.port.pre.mk>
.if ${OSREL} < 8
BUILD_DEPENDS+= ${LOCALBASE}/lib/libpcap.a:${PORTSDIR}/net/libpcap
.endif
.include <bsd.port.post.mk>
.include <bsd.port.mk>

View File

@ -0,0 +1,38 @@
--- ./prettypacket.h.orig 2012-12-04 10:31:27.000000000 +0100
+++ ./prettypacket.h 2014-03-06 14:57:20.000000000 +0100
@@ -102,7 +102,7 @@
* @param counter protocol number offset
* @return protocol number in host format
*/
-inline uint8_t protocol_8bit_extract(const char *packet_buffer, int counter) {
+uint8_t protocol_8bit_extract(const char *packet_buffer, int counter) {
return *(packet_buffer + counter);
}
@@ -113,7 +113,7 @@
* @param counter protocol number offset
* @return protocol number in host format
*/
-inline uint16_t protocol_16bit_extract(const char *packet_buffer, int counter) {
+uint16_t protocol_16bit_extract(const char *packet_buffer, int counter) {
return ntohs(*((uint16_t *)(packet_buffer + counter)));
}
@@ -123,7 +123,7 @@
* @param counter protocol number offset
* @return protocol number in host format
*/
-inline uint64_t protocol_48bit_extract(const char *packet_buffer, int counter) {
+uint64_t protocol_48bit_extract(const char *packet_buffer, int counter) {
uint64_t value = 0;
int i;
@@ -144,7 +144,7 @@
* @param counter read bytes counter
* @param field_text description of the field
*/
-inline field_print (const char *packet_buffer, int field_size, int *counter, const char *field_text) {
+void field_print (const char *packet_buffer, int field_size, int *counter, const char *field_text) {
char *tmp_hexstr = raw_to_hexstr(packet_buffer + *counter, field_size);
*counter += field_size;