Skip to content

Bug: "macro" seems deprecated (and can't compile) #87

Description

@dumblob

The macro module seems deprecated and unmaintained. It also can't compile:

cc -O2 -DDAO_WITH_NUMARRAY -DDAO_WITH_THREAD -DDAO_WITH_CONCURRENT -DDAO_WITH_RESTART -DTARGET_PLAT=\"linux\" -DLINUX=2 -DUNIX=1 -I../../kernel/ -I../auxlib/ -fPIC  -c dao_macro.c -o DaoMake.Objs/dao_macro.c.6579.o
dao_macro.c: In function ‘DaoNamespace_AddMacro’:
dao_macro.c:1287:28: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘globalMacros’
  DMap *macros = lang ? self->globalMacros : self->localMacros;
                            ^~
dao_macro.c:1287:49: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘localMacros’
  DMap *macros = lang ? self->globalMacros : self->localMacros;
                                                 ^~
In file included from ../../kernel/daoType.h:36:0,
                 from ../../kernel/daoParser.h:32,
                 from dao_macro.c:34:
dao_macro.c: In function ‘DaoNamespace_FindMacro2’:
dao_macro.c:1311:23: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘globalMacros’
  node = MAP_Find( self->globalMacros, combo );
                       ^
../../kernel/daoMap.h:112:45: note: in definition of macro ‘MAP_Find’
 #define MAP_Find( s, k ) DMap_Find( (DMap*)(s), (void*)(daoint)(k) )
                                             ^
dao_macro.c: In function ‘DaoNamespace_FindMacro’:
dao_macro.c:1328:28: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘localMacros’
  if( (node = MAP_Find( self->localMacros, name )) ) return (DaoMacro*) node->value.pVoid;
                            ^
../../kernel/daoMap.h:112:45: note: in definition of macro ‘MAP_Find’
 #define MAP_Find( s, k ) DMap_Find( (DMap*)(s), (void*)(daoint)(k) )
                                             ^
dao_macro.c:1333:28: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘localMacros’
  if( (node = MAP_Find( self->localMacros, combo )) ) goto ReturnMacro;
                            ^
../../kernel/daoMap.h:112:45: note: in definition of macro ‘MAP_Find’
 #define MAP_Find( s, k ) DMap_Find( (DMap*)(s), (void*)(daoint)(k) )
                                             ^
dao_macro.c:1334:28: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘globalMacros’
  if( (node = MAP_Find( self->globalMacros, combo )) ) goto ReturnMacro;
                            ^
../../kernel/daoMap.h:112:45: note: in definition of macro ‘MAP_Find’
 #define MAP_Find( s, k ) DMap_Find( (DMap*)(s), (void*)(daoint)(k) )
                                             ^
dao_macro.c:1341:19: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘globalMacros’
   MAP_Insert( self->globalMacros, combo, macro );
                   ^
../../kernel/daoMap.h:110:52: note: in definition of macro ‘MAP_Insert’
 #define MAP_Insert( s, k, v ) DMap_Insert( (DMap*)(s), (void*)(daoint)(k), (void*)(daoint)(v) )
                                                    ^
dao_macro.c: In function ‘DaoNamespace_ImportMacro’:
dao_macro.c:1359:24: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘globalMacros’
   for(it=DMap_First( ns->globalMacros ); it; it=DMap_Next(ns->globalMacros,it) ){
                        ^~
dao_macro.c:1359:61: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘globalMacros’
   for(it=DMap_First( ns->globalMacros ); it; it=DMap_Next(ns->globalMacros,it) ){
                                                             ^~
dao_macro.c: At top level:
dao_macro.c:1472:1: error: unknown type name ‘DaoTypeBase’
 DaoTypeBase macroTyper =
 ^~~~~~~~~~~
dao_macro.c:1474:2: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
  "Macro", NULL, NULL, NULL, {0}, {0},
  ^~~~~~~
dao_macro.c:1474:2: note: (near initialization for ‘macroTyper’)
dao_macro.c:1474:2: error: initializer element is not computable at load time
dao_macro.c:1474:2: note: (near initialization for ‘macroTyper’)
dao_macro.c:1474:2: warning: braces around scalar initializer
dao_macro.c:1474:2: note: (near initialization for ‘macroTyper’)
dao_macro.c:1474:29: warning: excess elements in scalar initializer
  "Macro", NULL, NULL, NULL, {0}, {0},
                             ^
dao_macro.c:1474:29: note: (near initialization for ‘macroTyper’)
dao_macro.c:1474:2: warning: braces around scalar initializer
  "Macro", NULL, NULL, NULL, {0}, {0},
  ^~~~~~~
dao_macro.c:1474:2: note: (near initialization for ‘macroTyper’)
dao_macro.c:1474:34: warning: excess elements in scalar initializer
  "Macro", NULL, NULL, NULL, {0}, {0},
                                  ^
dao_macro.c:1474:34: note: (near initialization for ‘macroTyper’)
dao_macro.c:1475:3: error: ‘FuncPtrDel’ undeclared here (not in a function)
  (FuncPtrDel)DaoMacro_Delete, NULL
   ^~~~~~~~~~
dao_macro.c:1475:2: warning: excess elements in scalar initializer
  (FuncPtrDel)DaoMacro_Delete, NULL
  ^
dao_macro.c:1475:2: note: (near initialization for ‘macroTyper’)
dao_macro.c:1475:14: error: expected ‘}’ before ‘DaoMacro_Delete’
  (FuncPtrDel)DaoMacro_Delete, NULL
              ^~~~~~~~~~~~~~~
dao_macro.c: In function ‘DaoMacro_OnLoad’:
dao_macro.c:1480:47: warning: passing argument 2 of ‘DaoNamespace_WrapType’ from incompatible pointer type [-Wincompatible-pointer-types]
  daox_type_macro = DaoNamespace_WrapType( ns, & macroTyper, DAO_CSTRUCT, 0 );
                                               ^
In file included from ../../kernel/daoConst.h:37:0,
                 from dao_macro.c:33:
../../kernel/dao.h:1132:18: note: expected ‘DaoTypeCore * {aka struct DaoTypeCore *}’ but argument is of type ‘int *’
 DAO_DLL DaoType* DaoNamespace_WrapType( DaoNamespace *self, DaoTypeCore *core, int tid, int options );
                  ^~~~~~~~~~~~~~~~~~~~~
In file included from ../../kernel/daoType.h:35:0,
                 from ../../kernel/daoParser.h:32,
                 from dao_macro.c:34:
dao_macro.c:1481:18: error: ‘DaoNamespace {aka struct DaoNamespace}’ has no member named ‘tokenFilters’
  DList_Append( ns->tokenFilters, (void*) DaoMacro_Preprocess );
                  ^
../../kernel/daoList.h:102:53: note: in definition of macro ‘DList_Append’
 #define DList_Append( self, val )   DList_PushBack( self, (void*)(daoint)(val) )
                                                     ^~~~

As macro support was dropped, we should probably also abandon this module and remove it from this repository.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions