Replace COSMO define with _COSMO_SOURCE

This change might cause ABI breakages for /opt/cosmos. It's needed to
help us better conform to header declaration practices.
This commit is contained in:
Justine Tunney 2023-08-13 20:31:27 -07:00
parent a033b65a33
commit c776a32f75
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
238 changed files with 858 additions and 1069 deletions

View file

@ -985,7 +985,7 @@ static bool gen_builtin_funcall(Node *node, const char *name) {
char regprefix;
gen_expr(node->args);
emitlin("\tor\t$-1,%edi");
regprefix = _endswith(name, "l") ? 'r' : 'e';
regprefix = endswith(name, "l") ? 'r' : 'e';
println("\tbsf\t%%%cax,%%%cax", regprefix, regprefix);
emitlin("\tcmovz\t%edi,%eax");
emitlin("\tinc\t%eax");
@ -1413,7 +1413,7 @@ void gen_expr(Node *node) {
case ND_FUNCALL: {
const char *funcname = NULL;
if (node->lhs->kind == ND_VAR) {
if (_startswith(nameof(node->lhs->var), "__builtin_")) {
if (startswith(nameof(node->lhs->var), "__builtin_")) {
funcname = nameof(node->lhs->var) + 10;
if (gen_builtin_funcall(node, funcname)) {
return;