Summary:ASTERISK-03971: [patch] put system headers before asterisk headers (part 1)
Reporter:Jeffrey C. Ollie (jcollie)Labels:
Date Opened:2005-04-21 23:40:16Date Closed:2008-01-15 15:32:39.000-0600
Versions:Frequency of
Environment:Attachments:( 0) asterisk-includeorder-1.patch.txt
( 1) translate_c_bug.txt
( 2) translate-patch.txt
Description:This patch does:

1) Reorder the includes so that all system headers come before the asterisk headers.
2) Puts a blank line inbetween the system headers and the asterisk headers.

This patch just fixes up the source code files in the top level directory. Patches for source code files in other directories forthcoming (as I get time).


Disclaimer on file.
Comments:By: Kevin P. Fleming (kpfleming) 2005-04-22 08:22:37

Committed to CVS, thanks!

By: Olle Johansson (oej) 2005-04-23 23:44:57

This breaks BSD compatibility. Need to include socket.h after asterisk files in translate.c - I'll check the specific details later, but for some reason moving socket.h to after the asterisk includes solved the issue.

By: Jeffrey C. Ollie (jcollie) 2005-04-23 23:50:09

I'd say that this is a bug in the asterisk headers then.  You should be able to list headers in any order that you want.  If a certiain header needs definitions from another header it should take care of that internally.

By: Jeffrey C. Ollie (jcollie) 2005-04-23 23:53:16

oej, can you post the exact error that you get when socket.h comes before the asterisk headers?

By: Olle Johansson (oej) 2005-04-26 06:05:55

acl.c is also broken. Needed to move inclusion of "<netinet/ip.h>" to after Asterisk includes to compile.

Asterisk.c is also giving me headache. Needed to include sys/time.h to get "struct timeval"

By: Jeffrey C. Ollie (jcollie) 2005-04-26 11:29:55

OEJ: can you try the patch that I just posted to see if it fixes your problem with translate.c?

By: Jeffrey C. Ollie (jcollie) 2005-04-26 11:33:09

OEJ: and here's a patch for asterisk.c

By: Olle Johansson (oej) 2005-04-26 14:04:36

Translate.c patch works, not asterisk.c - this works though. We include the same file twice :-)

--- asterisk.c  22 Apr 2005 13:11:34 -0000      1.150
+++ asterisk.c  26 Apr 2005 19:04:09 -0000
@@ -13,7 +13,7 @@

#include <unistd.h>
#include <stdlib.h>
-#include <sys/resource.h>
+#include <sys/time.h>
#include <fcntl.h>
#include <stdio.h>
#include <signal.h>

By: Kevin P. Fleming (kpfleming) 2005-04-29 12:35:47

Those two patches (translate.c and asterisk.c) committed to CVS. Thanks for the detective work...

By: Digium Subversion (svnbot) 2008-01-15 15:32:07.000-0600

Repository: asterisk
Revision: 5498

U   trunk/acl.c
U   trunk/app.c
U   trunk/ast_expr.y
U   trunk/asterisk.c
U   trunk/astmm.c
U   trunk/autoservice.c
U   trunk/callerid.c
U   trunk/cdr.c
U   trunk/channel.c
U   trunk/cli.c
U   trunk/config.c
U   trunk/config_old.c
U   trunk/db.c
U   trunk/dlfcn.c
U   trunk/dsp.c
U   trunk/file.c
U   trunk/frame.c
U   trunk/fskmodem.c
U   trunk/image.c
U   trunk/indications.c
U   trunk/io.c
U   trunk/jitterbuf.c
U   trunk/loader.c
U   trunk/logger.c
U   trunk/md5.c
U   trunk/muted.c
U   trunk/pbx.c
U   trunk/say.c
U   trunk/strcompat.c
U   trunk/tdd.c
U   trunk/term.c
U   trunk/translate.c
U   trunk/utils.c

r5498 | kpfleming | 2008-01-15 15:32:06 -0600 (Tue, 15 Jan 2008) | 2 lines

phase 1 of header include cleanup (bug ASTERISK-3971)



By: Digium Subversion (svnbot) 2008-01-15 15:32:39.000-0600

Repository: asterisk
Revision: 5534

U   trunk/asterisk.c
U   trunk/translate.c

r5534 | kpfleming | 2008-01-15 15:32:39 -0600 (Tue, 15 Jan 2008) | 2 lines

fix *BSD breakage from include-order changes (bug ASTERISK-3971)