initialize.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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.
  33. 2. You may modify your copy or copies of this source file or
  34. any portion of it, and copy and distribute such modifications under
  35. the terms of Paragraph 1 above, provided that you also do the following:
  36. a) cause the modified files to carry prominent notices stating
  37. that you changed the files and the date of any change; and
  38. b) cause the whole of any work that you distribute or publish,
  39. that in whole or in part contains or is a derivative of this
  40. program or any part thereof, to be freely distributed
  41. and licensed to all third parties on terms identical to those
  42. contained in this License Agreement (except that you may choose
  43. to grant more extensive warranty protection to third parties,
  44. at your option).
  45. 3. You may copy and distribute this program or any portion of it in
  46. compiled, executable or object code form under the terms of Paragraphs
  47. 1 and 2 above provided that you do the following:
  48. a) cause each such copy to be accompanied by the
  49. corresponding machine-readable source code, which must
  50. be distributed under the terms of Paragraphs 1 and 2 above; or,
  51. b) cause each such copy to be accompanied by a
  52. written offer, with no time limit, to give any third party
  53. free (except for a nominal shipping charge) a machine readable
  54. copy of the corresponding source code, to be distributed
  55. under the terms of Paragraphs 1 and 2 above; or,
  56. c) in the case of a recipient of this program in compiled, executable
  57. or object code form (without the corresponding source code) you
  58. shall cause copies you distribute to be accompanied by a copy
  59. of the written offer of source code which you received along
  60. with the copy you received.
  61. 4. You may not copy, sublicense, distribute or transfer this program
  62. except as expressly provided under this License Agreement. Any attempt
  63. otherwise to copy, sublicense, distribute or transfer this program is void and
  64. your rights to use the program under this License agreement shall be
  65. automatically terminated. However, parties who have received computer
  66. software programs from you with this License Agreement will not have
  67. their licenses terminated so long as such parties remain in full compliance.
  68. */
  69. /* Here a machine-specific header file must be included to define
  70. the macro FILEADDR_ROUND which we use to round up from the address
  71. of the end of one object file's text to the start of the next
  72. object file's text. */
  73. #include "m-vaxinit.h"
  74. /* This is used to make a file's initialization function.
  75. It calls another function named `initialize', which must
  76. appear later in the file. */
  77. #define START_FILE \
  78. static initialize (), initialize_next_file (); \
  79. static initialize_1 (offset) \
  80. { initialize (); initialize_next_file (offset); }
  81. /* The argument OFFSET is the size of this function.
  82. By adding it to the address of this function,
  83. we find the next function, which is the next file's
  84. initialization function. */
  85. #define END_FILE \
  86. static initialize_next_file (offset) \
  87. int offset; \
  88. { long addr = FILEADDR_ROUND ((int) initialize_next_file + offset); \
  89. (*(void (*) ()) addr) (offset); }