]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 114051 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Thu, 10 Apr 2008 22:02:32 +0000 (22:02 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 10 Apr 2008 22:02:32 +0000 (22:02 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r114051 | mmichelson | 2008-04-10 15:59:49 -0500 (Thu, 10 Apr 2008) | 3 lines

Fix 1.4 build when LOW_MEMORY is enabled.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114052 65c4cc65-6c06-0410-ace0-fbb531ad65f3

include/asterisk/lock.h
main/manager.c
main/utils.c
utils/Makefile
utils/ael_main.c
utils/astman.c
utils/check_expr.c
utils/conf2ael.c
utils/hashtest.c
utils/hashtest2.c

index 5d6ef43bba73045239ae02d1aae39f34776239ef..36c25a87d172dea08401c8e77b88e700f6f9b119 100644 (file)
@@ -148,18 +148,31 @@ enum ast_lock_type {
  * lock info struct.  The lock is marked as pending as the thread is waiting
  * on the lock.  ast_mark_lock_acquired() will mark it as held by this thread.
  */
+#if !defined(LOW_MEMORY)
 void ast_store_lock_info(enum ast_lock_type type, const char *filename,
        int line_num, const char *func, const char *lock_name, void *lock_addr);
+#else
+#define ast_store_lock_info(I,DONT,CARE,ABOUT,THE,PARAMETERS)
+#endif
+
 
 /*!
  * \brief Mark the last lock as acquired
  */
+#if !defined(LOW_MEMORY)
 void ast_mark_lock_acquired(void *lock_addr);
+#else
+#define ast_mark_lock_acquired(ignore)
+#endif
 
 /*!
  * \brief Mark the last lock as failed (trylock)
  */
+#if !defined(LOW_MEMORY)
 void ast_mark_lock_failed(void *lock_addr);
+#else
+#define ast_mark_lock_failed(ignore)
+#endif
 
 /*!
  * \brief remove lock info for the current thread
@@ -167,7 +180,11 @@ void ast_mark_lock_failed(void *lock_addr);
  * this gets called by ast_mutex_unlock so that information on the lock can
  * be removed from the current thread's lock info struct.
  */
+#if !defined(LOW_MEMORY)
 void ast_remove_lock_info(void *lock_addr);
+#else
+#define ast_remove_lock_info(ignore)
+#endif
 
 static void __attribute__((constructor)) init_empty_mutex(void)
 {
index a9147c57074756eab0b5702cd7c30250b9d14da1..69a889b6d7066b7184196f258758f4d425d8c8e9 100644 (file)
@@ -2625,7 +2625,9 @@ static int manager_modulecheck(struct mansession *s, const struct message *m)
        const char *module = astman_get_header(m, "Module");
        const char *id = astman_get_header(m, "ActionID");
        char idText[256];
+#if !defined(LOW_MEMORY)
        const char *version;
+#endif
        char filename[PATH_MAX];
        char *cut;
 
@@ -2644,14 +2646,18 @@ static int manager_modulecheck(struct mansession *s, const struct message *m)
        }
        snprintf(cut, (sizeof(filename) - strlen(filename)) - 1, ".c");
        ast_log(LOG_DEBUG, "**** ModuleCheck .c file %s\n", filename);
+#if !defined(LOW_MEMORY)
        version = ast_file_version_find(filename);
+#endif
 
        if (!ast_strlen_zero(id))
                snprintf(idText, sizeof(idText), "ActionID: %s\r\n", id);
        else
                idText[0] = '\0';
        astman_append(s, "Response: Success\r\n%s", idText);
+#if !defined(LOW_MEMORY)
        astman_append(s, "Version: %s\r\n\r\n", version ? version : "");
+#endif
        return 0;
 }
 
index 42fbb0a7a932b89cea011f1006d357432f060004..a55620ee340c8d02bce3301643ad33b27ee669d1 100644 (file)
@@ -1568,7 +1568,9 @@ int ast_utils_init(void)
 #endif
        base64_init();
 #ifdef DEBUG_THREADS
+#if !defined(LOW_MEMORY)
        ast_cli_register_multiple(utils_cli, sizeof(utils_cli) / sizeof(utils_cli[0]));
+#endif
 #endif
        return 0;
 }
index ca5a26c008bb98b7dc2508a9e5fdee1bf09253f7..9576cb5b09506ae4c3c8c0238c4c855086f306b8 100644 (file)
@@ -80,7 +80,7 @@ clean:
 
 md5.c: $(ASTTOPDIR)/main/md5.c
        @cp $< $@
-
+astman.o: astman.i
 astman: astman.o md5.o
 astman: LIBS+=$(NEWT_LIB)
 
index 74a432fa99786c9a00d26ea6bd57d1704f0303a3..71cfce3247050730d9565ccab1a9c9c4fa652649 100644 (file)
@@ -167,14 +167,17 @@ struct ast_custom_function *ast_custom_function_find(const char *name)
        return 0; /* in "standalone" mode, functions are just not avail */
 }
 
+void ast_register_file_version(const char *file, const char *version);
 void ast_register_file_version(const char *file, const char *version)
 {
 }
 
+void ast_unregister_file_version(const char *file);
 void ast_unregister_file_version(const char *file)
 {
 }
 
+#if !defined(LOW_MEMORY)
 int ast_add_profile(const char *x, uint64_t scale)
 {
        if (!no_comp)
@@ -182,6 +185,7 @@ int ast_add_profile(const char *x, uint64_t scale)
 
        return 0;
 }
+#endif
 
 int ast_loader_register(int (*updater)(void))
 {
@@ -600,7 +604,7 @@ unsigned int ast_hashtab_hash_contexts(const void *obj)
 }
 
 #ifdef DEBUG_THREADS
-
+#if !defined(LOW_MEMORY)
 void ast_mark_lock_acquired(void *lock_addr)
 {
 }
@@ -613,5 +617,5 @@ void ast_store_lock_info(enum ast_lock_type type, const char *filename,
        int line_num, const char *func, const char *lock_name, void *lock_addr)
 {
 }
-
+#endif
 #endif
index 2a450858904df91f8468b4a115cab8f3a84c1950..f674105a5234207d6a1f7cd35c6ee952c0405d65 100644 (file)
@@ -92,6 +92,7 @@ void ast_unregister_file_version(const char *file)
 {
 }
 
+#if !defined(LOW_MEMORY)
 int ast_add_profile(const char *, uint64_t scale);
 int ast_add_profile(const char *s, uint64_t scale)
 {
@@ -108,6 +109,7 @@ int64_t ast_mark(int key, int start1_stop0)
 {
        return 0;
 }
+#endif /* LOW_MEMORY */
 
 /* end of dummy functions */
 
index 260fd4e2e3cc6e98520a4b7c4d61fbc921971206..7b013f16362287243428a364da77d2639b032bc6 100644 (file)
@@ -85,6 +85,7 @@ enum ast_lock_type {
                AST_WRLOCK,
 };
 #endif
+#if !defined(LOW_MEMORY)
 void ast_store_lock_info(enum ast_lock_type type, const char *filename,
                        int line_num, const char *func, const char *lock_name, void *lock_addr);
 void ast_store_lock_info(enum ast_lock_type type, const char *filename,
@@ -104,6 +105,7 @@ void ast_remove_lock_info(void *lock_addr)
 {
     /* not a lot to do in a standalone w/o threading! */
 }
+#endif
 
 static int global_lineno = 1;
 static int global_expr_count=0;
@@ -145,9 +147,11 @@ unsigned int check_expr(char* buffer, char* error_report);
 int check_eval(char *buffer, char *error_report);
 void parse_file(const char *fname);
 
+void ast_register_file_version(const char *file, const char *version);  
 void ast_register_file_version(const char *file, const char *version) { }
+#if !defined(LOW_MEMORY)
 int ast_add_profile(const char *x, uint64_t scale) { return 0;} 
-
+#endif
 int ast_atomic_fetchadd_int_slow(volatile int *p, int v)
 {
         int ret;
@@ -156,6 +160,7 @@ int ast_atomic_fetchadd_int_slow(volatile int *p, int v)
         return ret;
 }
 
+void ast_unregister_file_version(const char *file);
 void ast_unregister_file_version(const char *file)
 {
 }
index c69486a33f9125f137660aa4fca73d2378fd33d8..4572cbd5d4b916843ef0958565287e86813ffeba 100644 (file)
@@ -78,15 +78,18 @@ char ast_config_AST_SYSTEM_NAME[20] = ""; */
 /* static AST_RWLIST_HEAD_STATIC(acf_root, ast_custom_function); */
 //extern char ast_config_AST_CONFIG_DIR[PATH_MAX];
 
+void ast_register_file_version(const char *file, const char *version);
 void ast_register_file_version(const char *file, const char *version)
 {
 }
 
+void ast_unregister_file_version(const char *file);
 void ast_unregister_file_version(const char *file)
 {
 }
+#if !defined(LOW_MEMORY)
 int ast_add_profile(const char *x, uint64_t scale) { return 0;}
-
+#endif
 /* Our own version of ast_log, since the expr parser uses it. -- stolen from utils/check_expr.c */
 void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...) __attribute__ ((format (printf,5,6)));
 
@@ -698,7 +701,7 @@ unsigned int ast_hashtab_hash_contexts(const void *obj)
 }
 
 #ifdef DEBUG_THREADS
-
+#if !defined(LOW_MEMORY)
 void ast_mark_lock_acquired(void *lock_addr)
 {
 }
@@ -711,5 +714,5 @@ void ast_store_lock_info(enum ast_lock_type type, const char *filename,
        int line_num, const char *func, const char *lock_name, void *lock_addr)
 {
 }
-
+#endif
 #endif
index e1780791fbbd7f5a186374c11f1208b85c1f9529..bce9d8c2e43fcf6f37755be717a33b2b864f050f 100644 (file)
@@ -43,11 +43,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 int testno = 1;
 
 /* stuff we need to make this work with the hashtab stuff */
-
+#if !defined(LOW_MEMORY)
 int64_t ast_mark(int prof_id, int x)
 {
        return 0;
 }
+#endif
 
 struct ht_element 
 {
@@ -299,11 +300,12 @@ int main(int argc,char **argv)
        
        return 0;
 }
-
+#if !defined(LOW_MEMORY)
 int  ast_add_profile(const char *x, uint64_t scale)
 {
        return 0;
 }
+#endif
 
 int ast_loader_register(int (*updater)(void))
 {
@@ -323,10 +325,12 @@ void ast_module_unregister(const struct ast_module_info *x)
 }
 
 
+void ast_register_file_version(const char *file, const char *version);
 void ast_register_file_version(const char *file, const char *version)
 {
 }
 
+void ast_unregister_file_version(const char *file);
 void ast_unregister_file_version(const char *file)
 {
 
index 0fe10ab758165308ffdceae18a56a53ab7024740..aa81719b60dc19b0bf94a950e4d3776197e609bf 100644 (file)
@@ -45,11 +45,12 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 int testno = 2;
 
 /* stuff we need to make this work with the astobj2 stuff */
-
+#if !defined(LOW_MEMORY)
 int64_t ast_mark(int prof_id, int x)
 {
        return 0;
 }
+#endif
 
 /* my OBJECT */
 struct ht_element 
@@ -311,11 +312,12 @@ int main(int argc,char **argv)
        return 0;
 }
 
-
+#if !defined(LOW_MEMORY)
 int ast_add_profile(const char *x, uint64_t scale)
 {
        return 0;
 }
+#endif
 
 int ast_loader_register(int (*updater)(void))
 {
@@ -335,10 +337,12 @@ void ast_module_unregister(const struct ast_module_info *x)
 }
 
 
+void ast_register_file_version(const char *file, const char *version);
 void ast_register_file_version(const char *file, const char *version)
 {
 }
 
+void ast_unregister_file_version(const char *file);
 void ast_unregister_file_version(const char *file)
 {