/*
 * Copyright (C) 2006. PathScale Inc. All Rights Reserved.
 */

/*

   Path64 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 version 3

   Path64 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 Path64; see the file COPYING.  If not, write to the Free
   Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
   02110-1301, USA.

*/

#include <stdio.h>
#include <stdlib.h>

#include "gspin-base-types.h"
#include "gspin-assert.h"

static void
gs_assert_failure (gs_string_t file, gs_string_t function, gs_count_t line,
                   const gs_string_t message)
{
  fprintf(stderr, "Assertion failure in file: %s, function: %s, line: %d.\n",
	  file, function, line);
  fprintf (stderr, "%s\n", message);
}

void gs_assert(bool condition, 
                     gs_string_t file, 
                     gs_string_t function, 
                     gs_count_t line, 
                     const gs_string_t message)
{
  if (condition == gs_true)
    return;
  gs_assert_failure(file, function, line, message);
}
