许多朋友都知道用C语言是可以实现面向对象程序设计的,但是具体到操作的细节部分就有些茫然不知所措了。为此作者在研究LW_OOPC的基础上,对其进行充分的简化,只保留最基本的面向对象功能,形成自己的OOSM宏包,其实这些东西已经够用了,以下是OOSM宏包的源代码:
/*
Object-Oriented Support Macros(OOSM)
OOSM is an object-oriented support macros, it makes the C programming language
with object-oriented programming capabilities.
LW_OOPC(http://sourceforge.net/projects/lwoopc/) means
Light-weight Object-Oriented Programming in C, written by MISOO team,
it is a very outstanding works!
OOSM inherits the essence of LW_OOPC and crops to retain the basic features.
OOSM written by Turingo Studio,
but anyone can copies modifies, and distributes it freely.
Hansome Sun(hansome.sun@gmail.com)
January 18, 2013
*/
#ifndef __OOSM_H__
#define __OOSM_H__
#include <stdlib.h>
#define class(type)