]> git.sesse.net Git - movit/commitdiff
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 8e35cfa19198723b77bce663eb69e0afba764119..5695c2eeef0428cd76460a64ead5d6b9cb76e4df 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,13 @@
 CC=gcc
 CC=gcc
+CXX=g++
 CFLAGS=-std=gnu99 -Wall
 LDFLAGS=-lSDL -lSDL_image -lGL
 
 test: test.o
 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
 
 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 34027dc47bc90b86b252af8962a9498d1708a3f3..c12cec65a6529c2da6fab67f6a3af713604bdd49 100644 (file)
--- a/test.c
+++ b/test.cpp
@@ -556,7 +556,7 @@ int main(int argc, char **argv)
                SDL_GL_SwapBuffers();
                check_error();
 
                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];
                check_error();
                if (screenshot) {
                        char filename[256];