commit 05f706839ac54da633d60916395a0b6b67e1093b
parent 96970c31c671030214c09a2d77b89e9d1ded75fe
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date: Sun, 26 Sep 2010 01:07:31 +0200
Message d'erreur pour l'initialisation de SDL.
Diffstat:
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
@@ -28,4 +28,4 @@ mrproper: clean
.Phony: test
test: $(EXEC)
- @./$(EXEC) || true
+ -./$(EXEC)
diff --git a/main.c b/main.c
@@ -1,8 +1,13 @@
+#include <stdlib.h>
#include <stdio.h>
#include <SDL/SDL.h>
int main(int argc, char** argv) {
- SDL_Init(SDL_INIT_VIDEO);
+ if (SDL_Init(SDL_INIT_VIDEO) != 0) {
+ fprintf(stderr, "Erreur à l'initialisation de SDL :");
+ fprintf(stderr, " %s", SDL_GetError());
+ exit(EXIT_FAILURE);
+ }