Change to C++.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Oct 2012 10:13:07 +0000 (12:13 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 1 Oct 2012 10:13:07 +0000 (12:13 +0200)
Makefile
test.cpp [moved from test.c with 99% similarity]

index 8e35cfa..5695c2e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,13 @@
 CC=gcc
+CXX=g++
 CFLAGS=-std=gnu99 -Wall
 LDFLAGS=-lSDL -lSDL_image -lGL
 
 test: test.o
-       $(CC) -o test test.o $(LDFLAGS)
+       $(CXX) -o test test.o $(LDFLAGS)
 
-.o: .c
-       $(CC) $(CXXFLAGS) $(CCFLAGS) -o $@ $<
+.o: .cpp
+       $(CXX) $(CXXFLAGS) $(CCFLAGS) -o $@ $<
 
 clean:
        $(RM) test test.o
diff --git a/test.c b/test.cpp
similarity index 99%
rename from test.c
rename to test.cpp
index 34027dc..c12cec6 100644 (file)
--- a/test.c
+++ b/test.cpp
@@ -556,7 +556,7 @@ int main(int argc, char **argv)
                SDL_GL_SwapBuffers();
                check_error();
 
-               unsigned char *screenbuf = glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY);
+               unsigned char *screenbuf = (unsigned char *)glMapBuffer(GL_PIXEL_PACK_BUFFER_ARB, GL_READ_ONLY);
                check_error();
                if (screenshot) {
                        char filename[256];