/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to src/utils.c

  • Committer: Gustav Hartvigsson
  • Date: 2015-04-07 17:58:58 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20150407175858-6kx2kvbn8pa1s82c
* Added some compile options to the root CMakeLists.txt
* Cleaned up some code in baseobject.h, baseobect.c and Func.h
* Added inclution guard to GlobalNotify.h
* Now uses macros instead of functions in utils.[c,h] for the print futctions
* Fixed Vec.[h,c] - Forgot to return self and used wrong type
* added test macros.
* Rewrote the ref-count test-case to use the new test macros.
  * Also fixed a circular call in baseobject.c

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
  return ret_val;
48
48
}
49
49
 
50
 
void s_print (const char * format, ...) {
51
 
  va_list args;
52
 
  va_start (args, format);
53
 
  fprintf (stdout, (char *) format, args);
54
 
  va_end (args);
55
 
}
56
 
 
57
 
void s_err_print (char * format, ...) {
58
 
  va_list args;
59
 
  va_start (args, format);
60
 
  fprintf (stderr,RED "[ERR] ");
61
 
  fprintf (stderr, format, args);
62
 
  fprintf (stderr, RESET);
63
 
  va_end (args);
64
 
}
65
 
 
66
 
#if DEBUG
67
 
  void s_dbg_print (char * format, ...) {
68
 
    va_list args;
69
 
    va_start (args, format);
70
 
    fprintf (stderr, YELLOW "[DEBUG] ");
71
 
    fprintf (stderr, format, args);
72
 
    fprintf (stderr, RESET);
73
 
    va_end (args);
74
 
  }
75
 
#else
76
 
  void s_dbg_print (char * format, ...) {
77
 
    /* do nothing */
78
 
  }
79
 
#endif