From 05f706839ac54da633d60916395a0b6b67e1093b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Sun, 26 Sep 2010 01:07:31 +0200 Subject: [PATCH] Message d'erreur pour l'initialisation de SDL. --- Makefile | 2 +- main.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fedcd86..72501e6 100644 --- 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 index fff9e97..e898737 100644 --- a/main.c +++ b/main.c @@ -1,8 +1,13 @@ +#include #include #include 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); + }