initialize.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /* Macros to enable automatic execution of an initialization function
  2. in each object file without having to include a list of all object files
  3. anywhere in the source code. This goes with firstfile.c and lastfile.c.
  4. Copyright (C) 1986 Free Software Foundation, Inc.
  5. NO WARRANTY
  6. BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
  7. NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
  8. WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
  9. RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
  10. WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
  11. BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  12. FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
  13. AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
  14. DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
  15. CORRECTION.
  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
  17. STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
  18. WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
  19. LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
  20. OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
  21. USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
  22. DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
  23. A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
  24. PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
  25. DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
  26. GENERAL PUBLIC LICENSE TO COPY
  27. 1. You may copy and distribute verbatim copies of this source file
  28. as you receive it, in any medium, provided that you conspicuously and
  29. appropriately publish on each copy a valid copyright notice "Copyright
  30. (C) 1986 Free Software Foundation, Inc."; and include following the
  31. copyright notice a verbatim copy of the above disclaimer of warranty
  32. and of this License. You may charge a distribution fee for the
  33. physical act of transferring a copy.
  34. 2. You may modify your copy or copies of this source file or
  35. any portion of it, and copy and distribute such modifications under
  36. the terms of Paragraph 1 above, provided that you also do the following:
  37. a) cause the modified files to carry prominent notices stating
  38. that you changed the files and the date of any change; and
  39. b) cause the whole of any work that you distribute or publish,
  40. that in whole or in part contains or is a derivative of this
  41. program or any part thereof, to be licensed at no charge to all
  42. third parties on terms identical to those contained in this
  43. License Agreement (except that you may choose to grant more
  44. extensive warranty protection to third parties, at your option).
  45. c) You may charge a distribution fee for the physical act of
  46. transferring a copy, and you may at your option offer warranty
  47. protection in exchange for a fee.
  48. 3. You may copy and distribute this program or any portion of it in
  49. compiled, executable or object code form under the terms of Paragraphs
  50. 1 and 2 above provided that you do the following:
  51. a) cause each such copy to be accompanied by the
  52. corresponding machine-readable source code, which must
  53. be distributed under the terms of Paragraphs 1 and 2 above; or,
  54. b) cause each such copy to be accompanied by a
  55. written offer, with no time limit, to give any third party
  56. free (except for a nominal shipping charge) a machine readable
  57. copy of the corresponding source code, to be distributed
  58. under the terms of Paragraphs 1 and 2 above; or,
  59. c) in the case of a recipient of this program in compiled, executable
  60. or object code form (without the corresponding source code) you
  61. shall cause copies you distribute to be accompanied by a copy
  62. of the written offer of source code which you received along
  63. with the copy you received.
  64. 4. You may not copy, sublicense, distribute or transfer this program
  65. except as expressly provided under this License Agreement. Any attempt
  66. otherwise to copy, sublicense, distribute or transfer this program is void and
  67. your rights to use the program under this License agreement shall be
  68. automatically terminated. However, parties who have received computer
  69. software programs from you with this License Agreement will not have
  70. their licenses terminated so long as such parties remain in full compliance.
  71. 5. If you wish to incorporate parts of this program into other free
  72. programs whose distribution conditions are different, write to the Free
  73. Software Foundation at 1000 Mass Ave, Cambridge, MA 02138. We have not yet
  74. worked out a simple rule that can be stated here, but we will often permit
  75. this. We will be guided by the two goals of preserving the free status of
  76. all derivatives our free software and of promoting the sharing and reuse of
  77. software.
  78. In other words, you are welcome to use, share and improve this program.
  79. You are forbidden to forbid anyone else to use, share and improve
  80. what you give them. Help stamp out software-hoarding! */
  81. /* Here a machine-specific header file must be included to define
  82. the macro FILEADDR_ROUND which we use to round up from the address
  83. of the end of one object file's text to the start of the next
  84. object file's text. */
  85. #include "m-vaxinit.h"
  86. /* This is used to make a file's initialization function.
  87. It calls another function named `initialize', which must
  88. appear later in the file. */
  89. #define START_FILE \
  90. static initialize (), initialize_next_file (); \
  91. static initialize_1 (offset) \
  92. { initialize (); initialize_next_file (offset); }
  93. /* The argument OFFSET is the size of this function.
  94. By adding it to the address of this function,
  95. we find the next function, which is the next file's
  96. initialization function. */
  97. #define END_FILE \
  98. static initialize_next_file (offset) \
  99. int offset; \
  100. { long addr = FILEADDR_ROUND ((int) initialize_next_file + offset); \
  101. (*(void (*) ()) addr) (offset); }