title: #include header with C declarations in an assembly file without errors?
body: <p>I have an assembly file (<code>asm.S</code>) which needs a constant <code>#define</code>'d in a C header file (<code>c_decls.h</code>).  The header file contains C function declarations in addition to the <code>#define</code> I want.  Unfortunately, <code>gcc</code> barfs when trying to compile the assembly file.  For example,</p>
  
  <p><strong>c_decls.h</strong></p>
  
  <pre><code>#ifndef __c_decls_h__
  #define __c_decls_h__
  
  #define I_NEED_THIS 0xBEEF
  int foo(int bar);
  
  #endif
  </code></pre>
  
  <p><strong>asm.S</strong></p>
  
  <pre><code>#include "c_decls.h"
  
  .globl main
  main:
      pushl %ebp
      movl %esp, %ebp
      movl $I_NEED_THIS, %eax
      leave
      ret
  </code></pre>
  
  <p><strong>Output</strong></p>
  
  <blockquote>
    <p>> gcc -m32 asm.S<br>
    c_decls.h: Assembler messages:<br>
    c_decls.h:6: Error: junk '(int bar)' after expression<br>
    c_decls.h:6: Error: suffix or operands invalid for 'int'</p>
  </blockquote>
  
  <p>Is there a way to <code>#include</code> a C header file that contains function declarations in an assembly file?  (Changing the header or moving/redefining the <code>#define</code> is not an option.)</p>