aboutsummaryrefslogblamecommitdiff
path: root/tst/va_test.c
blob: fdba4be4358f451f64615cb64b5beceb7b6542f8 (plain) (tree)
1
2
3
4
5
6


                   
                   
 
  









                                                                                                               
 






                                                                             



                   
 
                                          


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

/*
#define espik_debug_print (...) \
{ \
	va_list __ap; \
	char* __output; \
	__output = malloc (sizeof(char)* (strlen (__FUNCTION__", "__FILE__", "__LINE__" : ") + strlen(...))); \
	sprintf (__output, "%s: %s", __FUNCTION__", "__FILE__", "__LINE__" : ", ...); \
	va_start (__ap, __output); \
	vfprintf (stdout, __output, ap); \
	va_end (__ap); \
	free (__output); \
}
*/

#define espik_debug_print (fmt, ...) \
{ \
	fprintf (stdout, "%s, %s, %i: ", __FUNCTION__, __FILE__, __LINE__); \
	vfprintf (stdout, fmt, ## __VA_ARGS__); \
}

int main()
{
	int a = 10;

	espik_debug_print ("a : %d\n", a);

	return (0);
}