modernc.org/99c@v1.0.1-0.20181109153923-a9e8197063d9/examples/plugin/lib42.c (about)

     1  // +build ignore
     2  
     3  static int answer;
     4  
     5  int main()
     6  {
     7  	// Any library initialization comes here.
     8  	answer = 42;
     9  }
    10  
    11  // Use the -99lib option to prevent the linker from eliminating this function.
    12  int f42(int arg)
    13  {
    14  	return arg * answer;
    15  }