Changeset 25fe907 in git
- Timestamp:
- Jan 24, 2019, 1:07:07 PM (4 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- a3f0feac28fd347ce5b5d091108f9128d7b13554
- Parents:
- d0c48800963359deb121c3d103d17df80ba21b8e
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/blackbox.cc
rd0c488 r25fe907 10 10 // #define BLACKBOX_DEVEL 1 11 11 12 static blackbox* blackboxTable[MAX_BB_TYPES];13 static char * blackboxName[MAX_BB_TYPES];14 static int blackboxTableCnt=0;12 GLOBAL_VAR static blackbox* blackboxTable[MAX_BB_TYPES]; 13 GLOBAL_VAR static char * blackboxName[MAX_BB_TYPES]; 14 GLOBAL_VAR static int blackboxTableCnt=0; 15 15 #define BLACKBOX_OFFSET (MAX_TOK+1) 16 16 blackbox* getBlackboxStuff(const int t) … … 126 126 int setBlackboxStuff(blackbox *bb, const char *n) 127 127 { 128 int where=-1; 129 if (MAX_BB_TYPES<=blackboxTableCnt) 130 { 131 // second try, find empty slot from removed bb: 132 for (int i=0;i<MAX_BB_TYPES;i++) 133 { 134 if (blackboxTable[i]==NULL) { where=i; break; } 135 } 136 } 137 else 138 { 139 where=blackboxTableCnt; 140 blackboxTableCnt++; 128 int where = -1; 129 for (int i=0;i<MAX_BB_TYPES;i++) 130 { 131 if (blackboxTable[i]!=NULL && strcmp(blackboxName[i],n)==0) { 132 where = i; 133 break; 134 } 135 } 136 if (where < 0) { 137 if (MAX_BB_TYPES<=blackboxTableCnt) 138 { 139 // second try, find empty slot from removed bb: 140 for (int i=0;i<MAX_BB_TYPES;i++) 141 { 142 if (blackboxTable[i]==NULL) { where=i; break; } 143 } 144 } 145 else 146 { 147 where=blackboxTableCnt; 148 blackboxTableCnt++; 149 } 141 150 } 142 151 if (where==-1) -
Singular/iplib.cc
rd0c488 r25fe907 60 60 extern int yylp_errno; 61 61 extern int yylplineno; 62 extern c har *yylp_errlist[];62 extern const char *yylp_errlist[]; 63 63 void print_init(); 64 64 libstackv library_stack; … … 1088 1088 /*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ 1089 1089 #ifdef HAVE_DYNAMIC_LOADING 1090 BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport) 1090 #include <map> 1091 #include <string> 1092 #include <pthread.h> 1093 1094 STATIC_VAR std::map<std::string, void *> *dyn_modules; 1095 1096 bool registered_dyn_module(char *fullname) { 1097 if (dyn_modules == NULL) 1098 return false; 1099 std::string fname = fullname; 1100 return !(dyn_modules->count(fname)); 1101 } 1102 1103 void register_dyn_module(char *fullname, void * handle) { 1104 std::string fname = fullname; 1105 if (dyn_modules == NULL) 1106 dyn_modules = new std::map<std::string, void *>(); 1107 dyn_modules->insert(std::pair<std::string, void *>(fname, handle)); 1108 } 1109 1110 void close_all_dyn_modules() { 1111 for (std::map<std::string, void *>::iterator it = dyn_modules->begin(); 1112 it != dyn_modules->end(); 1113 it++) 1114 { 1115 dynl_close(it->second); 1116 } 1117 delete dyn_modules; 1118 dyn_modules = NULL; 1119 } 1120 BOOLEAN load_modules_aux(const char *newlib, char *fullname, BOOLEAN autoexport) 1091 1121 { 1092 1122 #ifdef HAVE_STATIC … … 1143 1173 } 1144 1174 IDPACKAGE(pl)->language = LANG_C; 1145 if ( dynl_check_opened(FullName))1175 if (registered_dyn_module(FullName)) 1146 1176 { 1147 1177 if (BVERBOSE(V_LOAD_LIB)) Warn( "%s already loaded as C library", fullname); … … 1178 1208 currPack->loaded=1; 1179 1209 currPack=s; /* reset currPack to previous */ 1210 register_dyn_module(fullname, IDPACKAGE(pl)->handle); 1180 1211 RET=FALSE; 1181 1212 } … … 1192 1223 return RET; 1193 1224 #endif /*STATIC */ 1225 } 1226 1227 BOOLEAN load_modules(const char *newlib, char *fullname, BOOLEAN autoexport) { 1228 GLOBAL_VAR static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; 1229 pthread_mutex_lock(&mutex); 1230 BOOLEAN r = load_modules_aux(newlib, fullname, autoexport); 1231 pthread_mutex_unlock(&mutex); 1232 return r; 1194 1233 } 1195 1234 #endif /* HAVE_DYNAMIC_LOADING */ -
Singular/tesths.cc
rd0c488 r25fe907 37 37 38 38 extern int siInit(char *); 39 #ifdef PSINGULAR 40 GLOBAL_VAR char *global_argv0; 41 #endif 39 42 40 43 int mmInit( void ) … … 63 66 omInitGetBackTrace(); 64 67 68 #ifdef PSINGULAR 69 global_argv0 = argv[0]; 70 #endif 65 71 siInit(argv[0]); 66 72 init_signals(); -
libpolys/polys/mod_raw.cc
rd0c488 r25fe907 147 147 ) 148 148 { 149 return dlopen(filename, RTLD_NOW|RTLD_GLOBAL); 150 #if 0 149 151 // glibc 2.2: 150 152 if ((filename==NULL) || (dlopen(filename,RTLD_NOW|RTLD_NOLOAD)==NULL)) … … 155 157 // alternative 156 158 // return(dlopen(filename, RTLD_NOW|RTLD_GLOBAL)); 159 #endif 157 160 } 158 161
Note: See TracChangeset
for help on using the changeset viewer.