1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:54:42 -07:00

gc: shuffle #includes

#include "go.h" (or "gg.h")

becomes

#include <u.h>
#include <libc.h>
#include "go.h"

so that go.y can #include <stdio.h>
after <u.h> but before "go.h".
This is necessary on Plan 9.

R=ken2
CC=golang-dev
https://golang.org/cl/4971041
This commit is contained in:
Russ Cox 2011-08-25 16:25:10 -04:00
parent 55db9fe730
commit 61f84a2cdc
58 changed files with 108 additions and 11 deletions

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
/* /*

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
/* /*

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
int thechar = '5'; int thechar = '5';

View File

@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#ifndef EXTERN #ifndef EXTERN
#define EXTERN extern #define EXTERN extern
#endif #endif

View File

@ -4,6 +4,8 @@
#undef EXTERN #undef EXTERN
#define EXTERN #define EXTERN
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
void void

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
// TODO(kaib): Can make this bigger if we move // TODO(kaib): Can make this bigger if we move

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
// TODO(kaib): make 5g/list.c congruent with 5l/list.c // TODO(kaib): make 5g/list.c congruent with 5l/list.c

View File

@ -29,6 +29,8 @@
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -29,6 +29,8 @@
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
/* /*

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
int thechar = '6'; int thechar = '6';

View File

@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#ifndef EXTERN #ifndef EXTERN
#define EXTERN extern #define EXTERN extern
#endif #endif

View File

@ -4,6 +4,8 @@
#undef EXTERN #undef EXTERN
#define EXTERN #define EXTERN
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
void void

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
// TODO(rsc): Can make this bigger if we move // TODO(rsc): Can make this bigger if we move

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
static int sconsize; static int sconsize;

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -5,6 +5,8 @@
// TODO(rsc): // TODO(rsc):
// assume CLD? // assume CLD?
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
void void

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
/* /*

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
int thechar = '8'; int thechar = '8';

View File

@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#ifndef EXTERN #ifndef EXTERN
#define EXTERN extern #define EXTERN extern
#endif #endif

View File

@ -4,6 +4,8 @@
#undef EXTERN #undef EXTERN
#define EXTERN #define EXTERN
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
void void

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
// TODO(rsc): Can make this bigger if we move // TODO(rsc): Can make this bigger if we move

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
static int sconsize; static int sconsize;

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
/* /*

View File

@ -28,6 +28,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE. // THE SOFTWARE.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
/* /*

View File

@ -6,6 +6,8 @@
* function literals aka closures * function literals aka closures
*/ */
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
void void

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
#define TUP(x,y) (((x)<<16)|(y)) #define TUP(x,y) (((x)<<16)|(y))

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
static void subnode(Node *nr, Node *ni, Node *nc); static void subnode(Node *nr, Node *ni, Node *nc);

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
#include "y.tab.h" #include "y.tab.h"

View File

@ -29,6 +29,8 @@
// unsafe with -m, more detailed analysis output with -mm // unsafe with -m, more detailed analysis output with -mm
// //
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
static void escfunc(Node *func); static void escfunc(Node *func);

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
#include "y.tab.h" #include "y.tab.h"

View File

@ -7,6 +7,8 @@
* mainly statements and control flow. * mainly statements and control flow.
*/ */
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
static void cgen_dcl(Node *n); static void cgen_dcl(Node *n);

View File

@ -2,8 +2,6 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include <bio.h> #include <bio.h>
#undef OAPPEND #undef OAPPEND

View File

@ -18,7 +18,9 @@
*/ */
%{ %{
#include <u.h>
#include <stdio.h> /* if we don't, bison will, and go.h re-#defines getc */ #include <stdio.h> /* if we don't, bison will, and go.h re-#defines getc */
#include <libc.h>
#include "go.h" #include "go.h"
static void fixlbrace(int); static void fixlbrace(int);

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
/* /*

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
#include "y.tab.h" #include "y.tab.h"
#include <ar.h> #include <ar.h>

View File

@ -5,6 +5,8 @@
// 64-bit MD5 (does full MD5 but returns 64 bits only). // 64-bit MD5 (does full MD5 but returns 64 bits only).
// Translation of ../../pkg/crypto/md5/md5*.go. // Translation of ../../pkg/crypto/md5/md5*.go.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
#include "md5.h" #include "md5.h"

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
/// uses arithmetic /// uses arithmetic

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
// //

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
/* /*

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
/* /*

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "gg.h" #include "gg.h"
#include "opt.h" #include "opt.h"

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
enum enum

View File

@ -6,6 +6,8 @@
* range * range
*/ */
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
void void

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
/* /*

View File

@ -6,6 +6,8 @@
* select * select
*/ */
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
void void

View File

@ -6,6 +6,8 @@
* static initialization * static initialization
*/ */
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
static NodeList *initlist; static NodeList *initlist;

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
#include "md5.h" #include "md5.h"
#include "y.tab.h" #include "y.tab.h"

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
enum enum

View File

@ -10,6 +10,8 @@
* rewrites n->op to be more specific in some cases. * rewrites n->op to be more specific in some cases.
*/ */
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
static void implicitstar(Node**); static void implicitstar(Node**);

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
/* /*

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
#include <u.h>
#include <libc.h>
#include "go.h" #include "go.h"
static Node* walkprint(Node*, NodeList**, int); static Node* walkprint(Node*, NodeList**, int);