Skip to content

Instantly share code, notes, and snippets.

@arajkumar
Last active December 29, 2015 01:49
Show Gist options
  • Save arajkumar/7596121 to your computer and use it in GitHub Desktop.
Save arajkumar/7596121 to your computer and use it in GitHub Desktop.
My Simple debugging statement :)
#pragma once
#ifndef ARDEBUG_H
#define ARDEBUG_H
#include <stdio.h>
#include <string.h>
static const char* s_fileName;
#define AR_PRINT(type,x...) do { s_fileName || (s_fileName = strrchr(__FILE__,'/') + 1) || (s_fileName = __FILE__); printf("%-16.32s:%6.6d:%6.6d %s *** ",s_fileName,__LINE__,getpid(), type); printf(x); printf("\n"); } while(0)
#define AR_DEBUG(x...) AR_PRINT("",x)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment