Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ User's Guide - the "alloc_text" pragma can be used to specify the name of the text segment http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
The "alloc_text" pragma can be used to specify the name of the text segment
into which the generated code for a function, or a list of functions, is to
be placed.  The following describes the form of the "alloc_text" pragma.

+--------------------------------------------------------------------------+
|      #pragma alloc_text ( seg_name, fn {, fn} ) [;]                      |
|                                                                          |
+--------------------------------------------------------------------------+

where
    description

seg_name
    is the name of the text segment.

fn
    is the name of a function.

Consider the following example.


     extern int fn1(int);
     extern int fn2(void);
     #pragma alloc_text ( my_text, fn1, fn2 );

The code for the functions fn1 and fn2 will be placed in the segment
my_text.  Note:  function prototypes for the named functions must exist
prior to the "alloc_text" pragma.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson