GNU   davin.50webs.com/research
Bringing to you notes for the ages

       Main Menu          Research Projects         Photo Album            Curriculum Vitae      The Greatest Artists
    Email Address       Computer Games          Web Design          Java Training Wheels      The Fly (A Story)   
  Political Activism   Scruff the Cat       My Life Story          Smoking Cessation          Other Links      
Debugging Macros     String Class I     Linked List System I Java for C Programmers Naming Convention
    String Class II         How I use m4              Strings III                 Symmetrical I/O             Linked Lists II     
Run-Time Type Info   Virtual Methods      An Array System        Science & Religion            Submodes       
  Nested Packages      Memory Leaks    Garbage Collection      Internet & Poverty      What is Knowledge?
Limits of Evolution   Emacs Additions      Function Plotter           Romantic Love        The Next Big Thing
    Science Fiction     Faster Compilation Theory of Morality         Elisp Scoping               Elisp Advice      
  S.O.G.M. Pattern       Safe Properties         School Bullying          Charisma Control          Life and Death    
     Splitting Java          Multiple Ctors       Religious Beliefs         Conversation 1           Conversation 2    
   J.T.W. Language    Emacs Additions II      Build Counter             Relation Plotter          Lisp++ Language  
  Memory Leaks II   Super Constructors CRUD Implementation Order a Website Form There Is An Afterlife
More Occam's Razor C to Java Translator Theory of Morality II


gccprefs.hh

    
#ifndef my_include_gccprefs_hh
#define my_include_gccprefs_hh

#ifndef MIN
#define MIN(x,y)     (((x) < (y)) ? (x) : (y))
#define MAX(x,y)     (((x) > (y)) ? (x) : (y))
#define MID(x,y,z)   MAX((x), MIN((y), (z)))
#endif

#ifndef ABS
#define ABS(x)       (((x) >= 0) ? (x) : (-(x)))
#endif

#ifndef SGN
#define SGN(x)       (((x) >= 0) ? 1 : -1)
#endif

#define strings_equal(a,b) (!strcmp((a),(b))) /* strcmp is ugly as it stands */
#define null      ((void*)0)  /* Java-style notation */
#define EXIT_FAILURE    1 /* from stdlib.h */
#define EXIT_SUCCESS    0 /* from stdlib.h */
#define ABSTRACT   /* for marking classes as non-instantiable, as with Java */
#define final      /* for marking classes as non-extendable, as with Java */
#define INT_MAX 2147483647              /* from limits.h */

#define PRINT(x) do { cout << #x << " = " << (x) << endl; } while (false)

void io_assert(const char* test, const char* file, int line);

#define ASSERT(test) (void)0  //((test)?0:io_assert(#test,__FILE__,__LINE__))

#if defined(NDEBUG)
#define assert(test) (void)0
#else
#define assert(test) ((test)?0:io_assert(#test,__FILE__,__LINE__))
#endif

#define CONTRACT(test, desc)                                    \
{                                                               \
   if (!(test)) {                                               \
      cout << "\n\n***  CONTRACT BROKEN: "                      \
           << "(" << __FILE__ << ":" << __LINE__ << ")\n\n"     \
           << " test: " << #test << "\n\n"                      \
           << " info: " << desc << "\n\n";                      \
      exit(EXIT_FAILURE);                                       \
   }                                                            \
}

#endif /* my_include_gccprefs_hh */
Back
| Main Menu | Research Projects | Photo Album | Curriculum Vitae | The Greatest Artists |
| Email Address | Computer Games | Web Design | Java Training Wheels | The Fly (A Story) |
| Political Activism | Scruff the Cat | My Life Story | Smoking Cessation | Other Links |
| Debugging Macros | String Class I | Linked List System I | Java for C Programmers | Naming Convention |
| String Class II | How I use m4 | Strings III | Symmetrical I/O | Linked Lists II |
| Run-Time Type Info | Virtual Methods | An Array System | Science & Religion | Submodes |
| Nested Packages | Memory Leaks | Garbage Collection | Internet & Poverty | What is Knowledge? |
| Limits of Evolution | Emacs Additions | Function Plotter | Romantic Love | The Next Big Thing |
| Science Fiction | Faster Compilation | Theory of Morality | Elisp Scoping | Elisp Advice |
| S.O.G.M. Pattern | Safe Properties | School Bullying | Charisma Control | Life and Death |
| Splitting Java | Multiple Ctors | Religious Beliefs | Conversation 1 | Conversation 2 |
| J.T.W. Language | Emacs Additions II | Build Counter | Relation Plotter | Lisp++ Language |
| Memory Leaks II | Super Constructors | CRUD Implementation | Order a Website Form | There Is An Afterlife |
| More Occam's Razor | C to Java Translator | Theory of Morality II
Last modified: Sun Sep 25 16:08:35 NZDT 2016
Best viewed at 800x600 or above resolution.
© Copyright 1999-2016 Davin Pearson.
Please report any broken links to