/* Copyright (C) 2020 Andrea G. Monaco * * This file is part of libre-sapienza. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "config.h" #include #include #include "gettext.h" #define _(String) gettext (String) /* try to allocate the requested memory, if it fails exit the program */ void *xmalloc (size_t s) { void *p = malloc (s); if (!p) { fprintf (stderr, _("memory exhausted!\n")); exit (1); } return p; }