Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Changes to compile with clang

  • Loading branch information...
commit c1d48fdce8c63a1cf1951fda4b2297214b325c63 1 parent 6f12467
@ry ry authored
Showing with 10 additions and 8 deletions.
  1. +8 −6 Makefile
  2. +2 −2 test.c
View
14 Makefile
@@ -1,30 +1,32 @@
OPT_DEBUG=-O0 -g -Wall -Wextra -Werror -I.
OPT_FAST=-O3 -DHTTP_PARSER_STRICT=0 -I.
+CC?=gcc
+
test: test_g
./test_g
test_g: http_parser_g.o test_g.o
- gcc $(OPT_DEBUG) http_parser_g.o test_g.o -o $@
+ $(CC) $(OPT_DEBUG) http_parser_g.o test_g.o -o $@
test_g.o: test.c http_parser.h Makefile
- gcc $(OPT_DEBUG) -c test.c -o $@
+ $(CC) $(OPT_DEBUG) -c test.c -o $@
test.o: test.c http_parser.h Makefile
- gcc $(OPT_FAST) -c test.c -o $@
+ $(CC) $(OPT_FAST) -c test.c -o $@
http_parser_g.o: http_parser.c http_parser.h Makefile
- gcc $(OPT_DEBUG) -c http_parser.c -o $@
+ $(CC) $(OPT_DEBUG) -c http_parser.c -o $@
test-valgrind: test_g
valgrind ./test_g
http_parser.o: http_parser.c http_parser.h Makefile
- gcc $(OPT_FAST) -c http_parser.c
+ $(CC) $(OPT_FAST) -c http_parser.c
test_fast: http_parser.o test.c http_parser.h
- gcc $(OPT_FAST) http_parser.o test.c -o $@
+ $(CC) $(OPT_FAST) http_parser.o test.c -o $@
test-run-timed: test_fast
while(true) do time ./test_fast > /dev/null; done
View
4 test.c
@@ -1019,7 +1019,7 @@ parser_free ()
parser = NULL;
}
-inline size_t parse (const char *buf, size_t len)
+size_t parse (const char *buf, size_t len)
{
size_t nparsed;
currently_parsing_eof = (len == 0);
@@ -1027,7 +1027,7 @@ inline size_t parse (const char *buf, size_t len)
return nparsed;
}
-inline size_t parse_count_body (const char *buf, size_t len)
+size_t parse_count_body (const char *buf, size_t len)
{
size_t nparsed;
currently_parsing_eof = (len == 0);

3 comments on commit c1d48fd

@jbergstroem

Hey, any reason you didn't merge my commit (http://github.com/jbergstroem/http-parser/commit/4c521a67fe5eaaee539cb68a4b66c8367afcc4fd)? Let me know if I'm doing something wrong and i'll try to fix it.

@ry
ry commented on c1d48fd

Sorry - it got lost in my inbox.

@lericson

Heh, funny how it's the exact same modifications though - one huge coincidence right there ;-) I mean especially what with the CC?=gcc part, that's not even necessary as CC is set by default in a Makefile.

Please sign in to comment.
Something went wrong with that request. Please try again.