mirror of
				https://github.com/wangyu-/udp2raw.git
				synced 2025-11-04 20:25:34 +08:00 
			
		
		
		
	fix linux compile
This commit is contained in:
		
							
								
								
									
										1
									
								
								main.cpp
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								main.cpp
									
									
									
									
									
								
							@@ -972,7 +972,6 @@ void sigint_cb(struct ev_loop *l, ev_signal *w, int revents)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
int main(int argc, char *argv[])
 | 
					int main(int argc, char *argv[])
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	init_pcap();
 | 
					 | 
				
			||||||
	int i=0;
 | 
						int i=0;
 | 
				
			||||||
	char errbuf[PCAP_ERRBUF_SIZE];
 | 
						char errbuf[PCAP_ERRBUF_SIZE];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										8
									
								
								makefile
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								makefile
									
									
									
									
									
								
							@@ -32,6 +32,14 @@ cygwin:git_version
 | 
				
			|||||||
	rm -f ${NAME}
 | 
						rm -f ${NAME}
 | 
				
			||||||
	${cc_local}   -o ${NAME}          -I. ${SOURCES} pcap_wrapper.cpp ${FLAGS} -lrt -ggdb -static -O2 -D_GNU_SOURCE
 | 
						${cc_local}   -o ${NAME}          -I. ${SOURCES} pcap_wrapper.cpp ${FLAGS} -lrt -ggdb -static -O2 -D_GNU_SOURCE
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					linux:git_version
 | 
				
			||||||
 | 
						rm -f ${NAME}
 | 
				
			||||||
 | 
						${cc_local}   -o ${NAME}          -I. ${SOURCES} ${PCAP} ${LIBNET} ${FLAGS} -lrt -ggdb -static -O2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					linux_nolibnet:git_version
 | 
				
			||||||
 | 
						rm -f ${NAME}
 | 
				
			||||||
 | 
						${cc_local}   -o ${NAME}          -I. ${SOURCES} ${PCAP} ${FLAGS} -lrt -ggdb -static -O2 -DNO_LIBNET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mac:git_version
 | 
					mac:git_version
 | 
				
			||||||
	rm -f ${NAME}
 | 
						rm -f ${NAME}
 | 
				
			||||||
	${cc_local}   -o ${NAME}          -I. ${SOURCES} ${FLAGS} -ggdb -O2
 | 
						${cc_local}   -o ${NAME}          -I. ${SOURCES} ${FLAGS} -ggdb -O2
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,6 +31,15 @@ char* (*pcap_lookupdev)(char *);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
int	(*pcap_findalldevs)(pcap_if_t **, char *);
 | 
					int	(*pcap_findalldevs)(pcap_if_t **, char *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					struct init_pcap_t
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						init_pcap_t()
 | 
				
			||||||
 | 
						{
 | 
				
			||||||
 | 
							init_pcap();
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
					}do_it;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int init_pcap()
 | 
					int init_pcap()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	HMODULE wpcap=LoadLibrary("wpcap.dll");
 | 
						HMODULE wpcap=LoadLibrary("wpcap.dll");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user