Modified STATIC_INIT to accept a statically declared variable.
This commit was SVN r10.
Этот коммит содержится в:
родитель
695dd34a8f
Коммит
456d544b1f
@ -27,6 +27,7 @@
|
||||
* GNU Lesser General Public License for more details.
|
||||
*/
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
#include <string.h>
|
||||
#include "lam/base/array.h"
|
||||
|
||||
lam_class_info_t array_cls = {"lam_array_t", &object_cls,
|
||||
|
@ -84,8 +84,8 @@ extern lam_class_info_t object_cls;
|
||||
dynamically allocated. */
|
||||
#define STATIC_INIT(obj, cls_ptr) \
|
||||
do { \
|
||||
OBJECT(obj)->obj_class = cls_ptr; \
|
||||
OBJECT(obj)->obj_class->cls_init(obj); \
|
||||
OBJECT(&(obj))->obj_class = cls_ptr; \
|
||||
OBJECT(&(obj))->obj_class->cls_init(OBJECT(&(obj))); \
|
||||
} while (0)
|
||||
|
||||
/* super_cls should be the pointer to the obj's parent
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user